summaryrefslogtreecommitdiffstats
path: root/sys/netinet/udp_usrreq.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1995-12-14 06:50:40 +0000
committerderaadt <deraadt@openbsd.org>1995-12-14 06:50:40 +0000
commitf3eb6470a8a3c103ad44fa724c6c7a9501818ea2 (patch)
tree91e69e2f2524da9cdf63b5589071841da61ce106 /sys/netinet/udp_usrreq.c
parentfrom netbsd; new mrouted (diff)
downloadwireguard-openbsd-f3eb6470a8a3c103ad44fa724c6c7a9501818ea2.tar.xz
wireguard-openbsd-f3eb6470a8a3c103ad44fa724c6c7a9501818ea2.zip
from netbsd:
make netinet work on systems where pointers and longs are 64 bits (like the alpha). Biggest problem: IP headers were overlayed with structure which included pointers, and which therefore didn't overlay properly on 64-bit machines. Solution: instead of threading pointers through IP header overlays, add a "queue element" structure to do the threading, and point it at the ip headers.
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r--sys/netinet/udp_usrreq.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 3742a68973d..b7647352803 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -1,4 +1,4 @@
-/* $NetBSD: udp_usrreq.c,v 1.24 1995/08/12 23:59:42 mycroft Exp $ */
+/* $NetBSD: udp_usrreq.c,v 1.25 1995/11/21 01:07:46 cgd Exp $ */
/*
* Copyright (c) 1982, 1986, 1988, 1990, 1993
@@ -142,9 +142,8 @@ udp_input(m, iphlen)
* Checksum extended UDP header and data.
*/
if (udpcksum && uh->uh_sum) {
- ((struct ipovly *)ip)->ih_next = 0;
- ((struct ipovly *)ip)->ih_prev = 0;
- ((struct ipovly *)ip)->ih_x1 = 0;
+ 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))) {
udpstat.udps_badsum++;
@@ -437,8 +436,7 @@ udp_output(inp, m, addr, control)
* and addresses and length put into network format.
*/
ui = mtod(m, struct udpiphdr *);
- ui->ui_next = ui->ui_prev = 0;
- ui->ui_x1 = 0;
+ bzero(ui->ui_x1, sizeof ui->ui_x1);
ui->ui_pr = IPPROTO_UDP;
ui->ui_len = htons((u_int16_t)len + sizeof (struct udphdr));
ui->ui_src = inp->inp_laddr;