aboutsummaryrefslogtreecommitdiff
path: root/sbin/route
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2013-07-18 02:34:25 +0000
committerHiroki Sato <hrs@FreeBSD.org>2013-07-18 02:34:25 +0000
commit8207f478fc372c7e648407bd53acd3ea8afd9112 (patch)
treeb83e718f6105c5a24b07e24f92433410d157abc9 /sbin/route
parent8ea4debe598272df67ade4797cafd3bf22ed7abe (diff)
downloadsrc-8207f478fc372c7e648407bd53acd3ea8afd9112.tar.gz
src-8207f478fc372c7e648407bd53acd3ea8afd9112.zip
Fix a gcc warning.
Pointy hat to: hrs
Notes
Notes: svn path=/head/; revision=253443
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 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) \