diff options
author | friehm <friehm@cvs.openbsd.org> | 2017-07-24 11:00:02 +0000 |
---|---|---|
committer | friehm <friehm@cvs.openbsd.org> | 2017-07-24 11:00:02 +0000 |
commit | f78ad8e188de00c6aaac2c42367fabb8e931405b (patch) | |
tree | 00ae8c0c6463d63c8f14fac5f1769d6bf1884b9d /usr.sbin/ospfd/kroute.c | |
parent | c764e5c743b5697032f2dde33bbb45521d0f5bce (diff) |
Unify ROUNDUP macros for parsing route messages.
Use the macro from route(8) / ospf6d(8) since it works also with argument 0.
OK claudio@
Diffstat (limited to 'usr.sbin/ospfd/kroute.c')
-rw-r--r-- | usr.sbin/ospfd/kroute.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/ospfd/kroute.c b/usr.sbin/ospfd/kroute.c index 3ab34f29277..17febefbdcb 100644 --- a/usr.sbin/ospfd/kroute.c +++ b/usr.sbin/ospfd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.107 2016/12/27 09:15:16 jca Exp $ */ +/* $OpenBSD: kroute.c,v 1.108 2017/07/24 11:00:01 friehm Exp $ */ /* * Copyright (c) 2004 Esben Norby <norby@openbsd.org> @@ -983,8 +983,8 @@ prefixlen2mask(u_int8_t prefixlen) return (htonl(0xffffffff << (32 - prefixlen))); } -#define ROUNDUP(a) \ - (((a) & (sizeof(long) - 1)) ? (1 + ((a) | (sizeof(long) - 1))) : (a)) +#define ROUNDUP(a) \ + ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) void get_rtaddrs(int addrs, struct sockaddr *sa, struct sockaddr **rti_info) |