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/bgpd/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/bgpd/kroute.c')
-rw-r--r-- | usr.sbin/bgpd/kroute.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/kroute.c b/usr.sbin/bgpd/kroute.c index 8f6687ae2da..d885fe50f56 100644 --- a/usr.sbin/bgpd/kroute.c +++ b/usr.sbin/bgpd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.215 2017/05/31 10:47:21 claudio Exp $ */ +/* $OpenBSD: kroute.c,v 1.216 2017/07/24 11:00:01 friehm Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -2446,8 +2446,8 @@ prefixlen2mask6(u_int8_t prefixlen) return (&mask); } -#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) |