diff options
author | briggs <briggs@cvs.openbsd.org> | 1997-01-18 17:31:03 +0000 |
---|---|---|
committer | briggs <briggs@cvs.openbsd.org> | 1997-01-18 17:31:03 +0000 |
commit | 8ec45e34edfee537f5d18e9768df8ca6470f90c3 (patch) | |
tree | 6072818f4c1fb0135020ae9165d7fe1209efe211 | |
parent | 8ddc03877a26c8073a3b087ab4c16eb21c645884 (diff) |
Do not partially initialize a structure at declaration in a function.
This causes gcc to generate a memset() on the m68k. Instead, bzero
and initialize the structure later in the function.
-rw-r--r-- | sys/netns/idp_usrreq.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/netns/idp_usrreq.c b/sys/netns/idp_usrreq.c index 98ac9d0616c..09d778f84f0 100644 --- a/sys/netns/idp_usrreq.c +++ b/sys/netns/idp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: idp_usrreq.c,v 1.3 1996/12/23 08:47:06 mickey Exp $ */ +/* $OpenBSD: idp_usrreq.c,v 1.4 1997/01/18 17:31:02 briggs Exp $ */ /* $NetBSD: idp_usrreq.c,v 1.9 1996/02/13 22:13:43 christos Exp $ */ /* @@ -78,7 +78,7 @@ idp_input(m, va_alist) register struct nspcb *nsp; register struct idp *idp = mtod(m, struct idp *); struct ifnet *ifp = m->m_pkthdr.rcvif; - struct sockaddr_ns idp_ns = { sizeof(idp_ns), AF_NS }; + struct sockaddr_ns idp_ns; va_list ap; va_start(ap, m); @@ -91,6 +91,9 @@ idp_input(m, va_alist) * Construct sockaddr format source address. * Stuff source address and datagram in user buffer. */ + bzero(&idp_ns, sizeof(idp_ns)); + idp_ns.sns_len = sizeof(idp_ns); + idp_ns.sns_family = AF_NS; idp_ns.sns_addr = idp->idp_sna; if (ns_neteqnn(idp->idp_sna.x_net, ns_zeronet) && ifp) { register struct ifaddr *ifa; |