diff options
author | glebius <glebius@FreeBSD.org> | 2005-08-09 08:37:28 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2005-08-09 08:37:28 +0000 |
commit | 4d15123a5e5e6ac11cc9299d2b1775e0d8f14e54 (patch) | |
tree | b022c938a810edf80251c808e62721c66cf2349f /sys | |
parent | 32083455b6d482f2b16b05f10c5c83e6f1dabfa1 (diff) | |
download | FreeBSD-src-4d15123a5e5e6ac11cc9299d2b1775e0d8f14e54.zip FreeBSD-src-4d15123a5e5e6ac11cc9299d2b1775e0d8f14e54.tar.gz |
- Use 'error' variable to store error value, instead of 'i'.
- Push 'i' into the only block where it is used.
- Remove redundant check for rt being NULL. If rt_check() hasn't
returned an error, then rt is valid.
Reviewed by: gnn
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet6/nd6.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index f93df61..76efccf 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -2028,11 +2028,13 @@ nd6_storelladdr(ifp, rt0, m, dst, desten) struct sockaddr *dst; u_char *desten; { - int i; struct sockaddr_dl *sdl; struct rtentry *rt; + int error; if (m->m_flags & M_MCAST) { + int i; + switch (ifp->if_type) { case IFT_ETHER: case IFT_FDDI: @@ -2063,17 +2065,12 @@ nd6_storelladdr(ifp, rt0, m, dst, desten) } } - i = rt_check(&rt, &rt0, dst); - if (i) { + error = rt_check(&rt, &rt0, dst); + if (error) { m_freem(m); - return i; + return (error); } - if (rt == NULL) { - /* this could happen, if we could not allocate memory */ - m_freem(m); - return (ENOMEM); - } if (rt->rt_gateway->sa_family != AF_LINK) { printf("nd6_storelladdr: something odd happens\n"); m_freem(m); |