mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-27 09:12:44 +00:00
traceroute6: Properly calculate UDP checksum
The revision D25604 capsicumize traceroute6. For UDP the send socket was changed from SOCK_DGRAM to SOCK_RAW and thus the UDP checksum need be calculated by application itself other than the kernel. outpacket is filled with zeros by line 707, thus the first round the UDP checksum is correct. But subsequent rounds outudp->uh_sum will be left with garbage. PR: 255507 Reviewed by: ae, markj, tuexen MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D30042
This commit is contained in:
parent
243b324f96
commit
1d712c0537
@ -1118,6 +1118,7 @@ send_probe(int seq, u_long hops)
|
|||||||
outudp->uh_sport = htons(ident);
|
outudp->uh_sport = htons(ident);
|
||||||
outudp->uh_dport = htons(port+seq);
|
outudp->uh_dport = htons(port+seq);
|
||||||
outudp->uh_ulen = htons(datalen);
|
outudp->uh_ulen = htons(datalen);
|
||||||
|
outudp->uh_sum = 0;
|
||||||
outudp->uh_sum = udp_cksum(&Src, &Dst, outpacket, datalen);
|
outudp->uh_sum = udp_cksum(&Src, &Dst, outpacket, datalen);
|
||||||
break;
|
break;
|
||||||
case IPPROTO_NONE:
|
case IPPROTO_NONE:
|
||||||
|
Loading…
Reference in New Issue
Block a user