Moved declaration of ifnet pointer out of the header file and into the

.c file where it belongs. Bezeroed some uninitialized malloc data.
This commit is contained in:
dg 1994-12-30 06:46:21 +00:00
parent 566a3ed4e6
commit 911a1abece
2 changed files with 5 additions and 3 deletions

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if.c 8.3 (Berkeley) 1/4/94
* $Id: if.c,v 1.10 1994/11/10 18:49:23 guido Exp $
* $Id: if.c,v 1.11 1994/12/21 22:56:58 wollman Exp $
*/
#include <sys/param.h>
@ -52,6 +52,7 @@
#include <ether.h>
int ifqmaxlen = IFQ_MAXLEN;
struct ifnet *ifnet;
/*
* Network interface utility routines.
@ -115,6 +116,7 @@ if_attach(ifp)
unsigned n = (if_indexlim <<= 1) * sizeof(ifa);
struct ifaddr **q = (struct ifaddr **)
malloc(n, M_IFADDR, M_WAITOK);
bzero((caddr_t)q, n);
if (ifnet_addrs) {
bcopy((caddr_t)ifnet_addrs, (caddr_t)q, n/2);
free((caddr_t)ifnet_addrs, M_IFADDR);

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if.h 8.1 (Berkeley) 6/10/93
* $Id: if.h,v 1.13 1994/12/21 22:56:59 wollman Exp $
* $Id: if.h,v 1.14 1994/12/22 07:20:03 davidg Exp $
*/
#ifndef _NET_IF_H_
@ -349,7 +349,7 @@ struct ifconf {
else \
(ifa)->ifa_refcnt--;
struct ifnet *ifnet;
extern struct ifnet *ifnet;
void ether_ifattach __P((struct ifnet *));
void ether_input __P((struct ifnet *, struct ether_header *, struct mbuf *));