summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ldpd
diff options
context:
space:
mode:
authorfriehm <friehm@openbsd.org>2017-07-24 11:00:01 +0000
committerfriehm <friehm@openbsd.org>2017-07-24 11:00:01 +0000
commit064707de76c63b6aa1383e86b88718756cccc566 (patch)
tree20952e81a606127c1617f689805737f28ea66f91 /usr.sbin/ldpd
parentReduce NET_LOCK() contention by moving the linktstate and watchdog (diff)
downloadwireguard-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.c6
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)