diff options
author | Ryan Moats <rmoats@us.ibm.com> | 2016-07-24 18:36:35 +0000 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2016-07-24 11:47:28 -0700 |
commit | ece9c2947dd5956708bcdb44922a2481da6b2f50 (patch) | |
tree | 5261f1d4f580784cfb9806d62b4cd0560443444f /ovn | |
parent | 218f9539f9ac359c7321c1cab9432c39648285f1 (diff) | |
download | openvswitch-ece9c2947dd5956708bcdb44922a2481da6b2f50.tar.gz |
Explain initialization when using csum()
The checksum method csum() requires its output location to be
intialized to zero when that output location is part of the
checksum. Add comments to the various places where csum is
called documenting where the initialization has occurred.
Signed-off-by: Ryan Moats <rmoats@us.ibm.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ovn')
-rw-r--r-- | ovn/controller/pinctrl.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c index 62f4748c3..0ae6501ec 100644 --- a/ovn/controller/pinctrl.c +++ b/ovn/controller/pinctrl.c @@ -345,6 +345,7 @@ pinctrl_handle_put_dhcp_opts( struct ip_header *out_ip = dp_packet_l3(&pkt_out); out_ip->ip_tot_len = htons(pkt_out.l4_ofs - pkt_out.l3_ofs + new_l4_size); udp->udp_csum = 0; + /* Checksum needs to be initialized to zero. */ out_ip->ip_csum = 0; out_ip->ip_csum = csum(out_ip, sizeof *out_ip); |