From 92461a53112ca6e7698be66a797a4429b2cc4210 Mon Sep 17 00:00:00 2001 From: Cliff Frey Date: Fri, 15 Feb 2013 14:56:53 -0800 Subject: [PATCH] udpip6encap: fix checksum calculation Signed-off-by: Cliff Frey --- elements/tcpudp/udpip6encap.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/elements/tcpudp/udpip6encap.cc b/elements/tcpudp/udpip6encap.cc index d8e4983bcb..a03603b70b 100644 --- a/elements/tcpudp/udpip6encap.cc +++ b/elements/tcpudp/udpip6encap.cc @@ -117,6 +117,7 @@ UDPIP6Encap::simple_action(Packet *p_in) udp->uh_sport = _sport; udp->uh_dport = _dport; udp->uh_ulen = plen; + udp->uh_sum = 0; //TO DO: ADD SUPPORT FOR CORRECT CHECKSUM IN CASE OF ROUTING HEADER udp->uh_sum = htons(in6_fast_cksum(&ip6->ip6_src, &ip6->ip6_dst, udp->uh_ulen, ip6->ip6_nxt, udp->uh_sum, (unsigned char *)(udp), udp->uh_ulen)); //reuse the icmp6 checksum calculation from ip6ndsolicitor.cc, because ICMPv6 uses the same checksum as UDP over IPv6 (see RFC 2460, 8.1)