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 /sbin | |
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 'sbin')
-rw-r--r-- | sbin/dhclient/kroute.c | 6 | ||||
-rw-r--r-- | sbin/slaacd/frontend.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sbin/dhclient/kroute.c b/sbin/dhclient/kroute.c index 8e746024bb8..5519995f4ea 100644 --- a/sbin/dhclient/kroute.c +++ b/sbin/dhclient/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.114 2017/07/23 13:44:53 krw Exp $ */ +/* $OpenBSD: kroute.c,v 1.115 2017/07/24 11:00:01 friehm Exp $ */ /* * Copyright 2012 Kenneth R Westerback <krw@openbsd.org> @@ -47,8 +47,8 @@ #include "log.h" #include "privsep.h" -#define ROUNDUP(a) ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : \ - sizeof(long)) +#define ROUNDUP(a) \ + ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) /* * flush_unpriv_ibuf makes sure queued messages are delivered to the diff --git a/sbin/slaacd/frontend.c b/sbin/slaacd/frontend.c index 8bd49e2f1ad..f78c9802292 100644 --- a/sbin/slaacd/frontend.c +++ b/sbin/slaacd/frontend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frontend.c,v 1.4 2017/07/14 09:29:40 florian Exp $ */ +/* $OpenBSD: frontend.c,v 1.5 2017/07/24 11:00:01 friehm Exp $ */ /* * Copyright (c) 2017 Florian Obser <florian@openbsd.org> @@ -684,8 +684,8 @@ handle_route_message(struct rt_msghdr *rtm, struct sockaddr **rti_info) } -#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) |