aboutsummaryrefslogtreecommitdiff
path: root/sbin/route/route.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/route/route.c')
-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 6e3b25735dd5..b829bd29336b 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) \