diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2004-03-21 20:58:11 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2004-03-21 20:58:11 +0000 |
commit | 8f03be1706c088eaf9fa82c7f62a34857a111d9d (patch) | |
tree | d48bc059c736f5a2fab164bf529609fc9de36eb0 /sys/netinet/udp_usrreq.c | |
parent | d75fb8e03ddda66883c101db9759403de9ea8339 (diff) |
fix udp checksum verification if ip options are present;
report from Pyun via dhartmei@; ok mcbride@, dhartmei@
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r-- | sys/netinet/udp_usrreq.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 4f40fd45230..92db5bf4ac2 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udp_usrreq.c,v 1.98 2004/02/17 12:07:45 markus Exp $ */ +/* $OpenBSD: udp_usrreq.c,v 1.99 2004/03/21 20:58:10 markus Exp $ */ /* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */ /* @@ -293,12 +293,8 @@ udp_input(struct mbuf *m, ...) return; } - bzero(((struct ipovly *)ip)->ih_x1, - sizeof ((struct ipovly *)ip)->ih_x1); - ((struct ipovly *)ip)->ih_len = uh->uh_ulen; - - if ((uh->uh_sum = in_cksum(m, len + - sizeof (struct ip))) != 0) { + if ((uh->uh_sum = in4_cksum(m, IPPROTO_UDP, + iphlen, len))) { udpstat.udps_badsum++; m_freem(m); return; |