diff options
| author | Brooks Davis <brooks@FreeBSD.org> | 2004-02-02 21:55:34 +0000 |
|---|---|---|
| committer | Brooks Davis <brooks@FreeBSD.org> | 2004-02-02 21:55:34 +0000 |
| commit | ccb82468ac0fc4b61cd916208882d50f2b9de59e (patch) | |
| tree | 8bb12d615b9e2b9f174109969743c53ba242a59f /sys/net | |
| parent | 2082e6d249b7d129e45f0e422861b48956847dd3 (diff) | |
Notes
Diffstat (limited to 'sys/net')
| -rw-r--r-- | sys/net/if.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index c31e46a9ea94..8d68043b43c9 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -412,11 +412,9 @@ if_attach(struct ifnet *ifp) namelen = strlen(ifp->if_xname); masklen = offsetof(struct sockaddr_dl, sdl_data[0]) + namelen; socksize = masklen + ifp->if_addrlen; -#define ROUNDUP(a) (1 + (((a) - 1) | (sizeof(long) - 1))) if (socksize < sizeof(*sdl)) socksize = sizeof(*sdl); - socksize = ROUNDUP(socksize); -#undef ROUNDUP + socksize = roundup2(socksize, sizeof(long)); ifasize = sizeof(*ifa) + 2 * socksize; ifa = malloc(ifasize, M_IFADDR, M_WAITOK | M_ZERO); IFA_LOCK_INIT(ifa); |
