Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Jan 2013 21:44:22 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r246095 - head/sys/net
Message-ID:  <201301292144.r0TLiMYs064276@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Tue Jan 29 21:44:22 2013
New Revision: 246095
URL: http://svnweb.freebsd.org/changeset/base/246095

Log:
  route_output() always supplies info with RTAX_GATEWAY member that
  points to a sockaddr of AF_LINK family. Assert this instead of
  checking.

Modified:
  head/sys/net/if_llatbl.c

Modified: head/sys/net/if_llatbl.c
==============================================================================
--- head/sys/net/if_llatbl.c	Tue Jan 29 21:37:56 2013	(r246094)
+++ head/sys/net/if_llatbl.c	Tue Jan 29 21:44:22 2013	(r246095)
@@ -273,10 +273,9 @@ lla_rt_output(struct rt_msghdr *rtm, str
 	u_int laflags = 0, flags = 0;
 	int error = 0;
 
-	if (dl == NULL || dl->sdl_family != AF_LINK) {
-		log(LOG_INFO, "%s: invalid dl\n", __func__);
-		return EINVAL;
-	}
+	KASSERT(dl != NULL && dl->sdl_family == AF_LINK,
+	    ("%s: invalid dl\n", __func__));
+
 	ifp = ifnet_byindex(dl->sdl_index);
 	if (ifp == NULL) {
 		log(LOG_INFO, "%s: invalid ifp (sdl_index %d)\n",



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