diff options
author | hrs <hrs@FreeBSD.org> | 2013-07-18 02:34:25 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2013-07-18 02:34:25 +0000 |
commit | 6ccba3847e97bb18e337664bb2649b134868b172 (patch) | |
tree | b83e718f6105c5a24b07e24f92433410d157abc9 /sbin/route | |
parent | c72560d44a157e40cdcc6f2ef49f9d9de22cd2b0 (diff) | |
download | FreeBSD-src-6ccba3847e97bb18e337664bb2649b134868b172.zip FreeBSD-src-6ccba3847e97bb18e337664bb2649b134868b172.tar.gz |
Fix a gcc warning.
Pointy hat to: hrs
Diffstat (limited to 'sbin/route')
-rw-r--r-- | sbin/route/route.c | 5 |
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) \ |