From: tobhe Date: Thu, 25 Mar 2021 01:39:09 +0000 (+0000) Subject: Sync correct ROUNDUP() from net/route.c X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d3cfb0fa17023a1905ffbe62fe8db2a415d41a35;p=openbsd Sync correct ROUNDUP() from net/route.c --- diff --git a/sbin/iked/vroute.c b/sbin/iked/vroute.c index 7c7ad3b324e..8538edcf415 100644 --- a/sbin/iked/vroute.c +++ b/sbin/iked/vroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vroute.c,v 1.6 2021/02/28 19:25:59 tobhe Exp $ */ +/* $OpenBSD: vroute.c,v 1.7 2021/03/25 01:39:09 tobhe Exp $ */ /* * Copyright (c) 2021 Tobias Heider @@ -37,8 +37,7 @@ #define IKED_VROUTE_PRIO 6 -#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)) int vroute_setroute(struct iked *, uint8_t, struct sockaddr *, uint8_t, struct sockaddr *, int);