diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2004-04-14 05:34:16 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2004-04-14 05:34:16 +0000 |
commit | 428cbe21c8ea8d245eea9f492338ac5e6f1c6b32 (patch) | |
tree | 6ce1818533336aa6cba6e9b88f621f2084d650b8 /sys/netinet/udp_usrreq.c | |
parent | eab602ea3ec9083f31c2e1c7607407a486fb0f8b (diff) |
with IPv6, udp checksum is mandatory. henning ok
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r-- | sys/netinet/udp_usrreq.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 92db5bf4ac2..fe5538c0b92 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udp_usrreq.c,v 1.99 2004/03/21 20:58:10 markus Exp $ */ +/* $OpenBSD: udp_usrreq.c,v 1.100 2004/04/14 05:34:15 itojun Exp $ */ /* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */ /* @@ -278,6 +278,10 @@ udp_input(struct mbuf *m, ...) /* * In IPv6, the UDP checksum is ALWAYS used. */ + if (uh->uh_sum == 0) { + udpstat.udps_nosum++; + goto bad; + } if ((uh->uh_sum = in6_cksum(m, IPPROTO_UDP, iphlen, len))) { udpstat.udps_badsum++; goto bad; @@ -540,6 +544,7 @@ udp_input(struct mbuf *m, ...) } #ifdef INET6 if (ip6) { + uh->uh_sum = savesum; icmp6_error(m, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_NOPORT,0); } else |