summaryrefslogtreecommitdiff
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-06-01 17:49:12 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-06-01 17:49:12 +0000
commitc827d869575a1a350da5f496ca62f1bf403e269f (patch)
treed78687d585b4111381fff20964262d0ea353a005 /sys/net/if.c
parentd30afc0ec38415711bc30130e9412a6026468e8b (diff)
There is no need to use a variable just for sizeof(). Garbage collect ifa.
No binary change.
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 30e7305e745..22e8671cd1a 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.191 2009/05/31 20:22:18 blambert Exp $ */
+/* $OpenBSD: if.c,v 1.192 2009/06/01 17:49:11 claudio Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -204,7 +204,6 @@ struct ifnet *lo0ifp;
void
if_attachsetup(struct ifnet *ifp)
{
- struct ifaddr *ifa;
int wrapped = 0;
if (ifindex2ifnet == 0)
@@ -253,8 +252,8 @@ if_attachsetup(struct ifnet *ifp)
if_indexlim <<= 1;
/* grow ifnet_addrs */
- m = oldlim * sizeof(ifa);
- n = if_indexlim * sizeof(ifa);
+ m = oldlim * sizeof(struct ifaddr *);
+ n = if_indexlim * sizeof(struct ifaddr *);
q = (caddr_t)malloc(n, M_IFADDR, M_WAITOK|M_ZERO);
if (ifnet_addrs) {
bcopy((caddr_t)ifnet_addrs, q, m);