diff options
author | glebius <glebius@FreeBSD.org> | 2013-01-29 21:44:22 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2013-01-29 21:44:22 +0000 |
commit | 5e925b9e5a07caa7529cc49e21f2bc28ae835962 (patch) | |
tree | c9869feab18aadec0a528bca8baf30e975cc9d7e /sys/net/if_llatbl.c | |
parent | 2ae2587f8343b7f0559fbe2ebfd6d62814451c37 (diff) | |
download | FreeBSD-src-5e925b9e5a07caa7529cc49e21f2bc28ae835962.zip FreeBSD-src-5e925b9e5a07caa7529cc49e21f2bc28ae835962.tar.gz |
route_output() always supplies info with RTAX_GATEWAY member that
points to a sockaddr of AF_LINK family. Assert this instead of
checking.
Diffstat (limited to 'sys/net/if_llatbl.c')
-rw-r--r-- | sys/net/if_llatbl.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/net/if_llatbl.c b/sys/net/if_llatbl.c index 5812623..c1c91ba 100644 --- a/sys/net/if_llatbl.c +++ b/sys/net/if_llatbl.c @@ -273,10 +273,9 @@ lla_rt_output(struct rt_msghdr *rtm, struct rt_addrinfo *info) 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", |