summaryrefslogtreecommitdiffstats
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2004-02-02 21:55:34 +0000
committerbrooks <brooks@FreeBSD.org>2004-02-02 21:55:34 +0000
commit091c7e4af04a24539b0bc31efc3e922550749e1e (patch)
tree8bb12d615b9e2b9f174109969743c53ba242a59f /sys/net/if.c
parentaef6df446038e0e880544e3acf5c10308b1c9647 (diff)
downloadFreeBSD-src-091c7e4af04a24539b0bc31efc3e922550749e1e.zip
FreeBSD-src-091c7e4af04a24539b0bc31efc3e922550749e1e.tar.gz
More macro cleanup. Use the system roundup2() macro instead of making
our own ROUNDUP() macro. Suggested by: bde
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index c31e46a..8d68043 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);
OpenPOWER on IntegriCloud