summaryrefslogtreecommitdiffstats
path: root/sbin/route
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/route')
-rw-r--r--sbin/route/route.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index 6e3b257..b829bd2 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -1457,7 +1457,10 @@ rtmsg(int cmd, int flags, int fib)
#define NEXTADDR(w, u) \
if (rtm_addrs & (w)) { \
- l = SA_SIZE((struct sockaddr *)&(u)); \
+ l = (((struct sockaddr *)&(u))->sa_len == 0) ? \
+ sizeof(long) : \
+ 1 + ((((struct sockaddr *)&(u))->sa_len - 1) \
+ | (sizeof(long) - 1)); \
memmove(cp, (char *)&(u), l); \
cp += l; \
if (verbose) \
OpenPOWER on IntegriCloud