Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Jul 2013 02:34:26 +0000 (UTC)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r253443 - head/sbin/route
Message-ID:  <201307180234.r6I2YQ2J033895@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hrs
Date: Thu Jul 18 02:34:25 2013
New Revision: 253443
URL: http://svnweb.freebsd.org/changeset/base/253443

Log:
  Fix a gcc warning.
  
  Pointy hat to:	hrs

Modified:
  head/sbin/route/route.c

Modified: head/sbin/route/route.c
==============================================================================
--- head/sbin/route/route.c	Thu Jul 18 01:40:31 2013	(r253442)
+++ head/sbin/route/route.c	Thu Jul 18 02:34:25 2013	(r253443)
@@ -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)						\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307180234.r6I2YQ2J033895>