diff options
author | friehm <friehm@openbsd.org> | 2017-07-24 11:00:01 +0000 |
---|---|---|
committer | friehm <friehm@openbsd.org> | 2017-07-24 11:00:01 +0000 |
commit | 064707de76c63b6aa1383e86b88718756cccc566 (patch) | |
tree | 20952e81a606127c1617f689805737f28ea66f91 /usr.sbin/ldpd | |
parent | Reduce NET_LOCK() contention by moving the linktstate and watchdog (diff) | |
download | wireguard-openbsd-064707de76c63b6aa1383e86b88718756cccc566.tar.xz wireguard-openbsd-064707de76c63b6aa1383e86b88718756cccc566.zip |
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/ldpd')
-rw-r--r-- | usr.sbin/ldpd/kroute.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/ldpd/kroute.c b/usr.sbin/ldpd/kroute.c index 7e20c40f5c1..3b0fd90f7cb 100644 --- a/usr.sbin/ldpd/kroute.c +++ b/usr.sbin/ldpd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.65 2017/03/04 00:21:48 renato Exp $ */ +/* $OpenBSD: kroute.c,v 1.66 2017/07/24 11:00:01 friehm Exp $ */ /* * Copyright (c) 2015, 2016 Renato Westphal <renato@openbsd.org> @@ -947,8 +947,8 @@ prefixlen_classful(in_addr_t ina) return (8); } -#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)) static void get_rtaddrs(int addrs, struct sockaddr *sa, struct sockaddr **rti_info) |