summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/ip6_forward.c
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2003-10-08 18:26:08 +0000
committerume <ume@FreeBSD.org>2003-10-08 18:26:08 +0000
commitcb2c1545ab3b25d366aeb88623dd50ed9349e174 (patch)
tree0e57d38335c69eed019dcea1730b3cd22ff6025e /sys/netinet6/ip6_forward.c
parent8f2de8390a373f0018eb9a8bb4cab9e630163357 (diff)
downloadFreeBSD-src-cb2c1545ab3b25d366aeb88623dd50ed9349e174.zip
FreeBSD-src-cb2c1545ab3b25d366aeb88623dd50ed9349e174.tar.gz
- fix typo in comments.
- style. - NULL is not 0. - some variables were renamed. - nuke unused logic. (there is no functional change.) Obtained from: KAME
Diffstat (limited to 'sys/netinet6/ip6_forward.c')
-rw-r--r--sys/netinet6/ip6_forward.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c
index b625f0a..0d1c4ca 100644
--- a/sys/netinet6/ip6_forward.c
+++ b/sys/netinet6/ip6_forward.c
@@ -139,7 +139,7 @@ ip6_forward(m, srcrt)
* Do not forward packets to multicast destination (should be handled
* by ip6_mforward().
* Do not forward packets with unspecified source. It was discussed
- * in July 2000, on ipngwg mailing list.
+ * in July 2000, on the ipngwg mailing list.
*/
if ((m->m_flags & (M_BCAST|M_MCAST)) != 0 ||
IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) ||
@@ -181,8 +181,8 @@ ip6_forward(m, srcrt)
#ifdef IPSEC
/* get a security policy for this packet */
- sp = ipsec6_getpolicybyaddr(m, IPSEC_DIR_OUTBOUND, IP_FORWARDING,
- &error);
+ sp = ipsec6_getpolicybyaddr(m, IPSEC_DIR_OUTBOUND,
+ IP_FORWARDING, &error);
if (sp == NULL) {
ipsec6stat.out_inval++;
ip6stat.ip6s_cantforward++;
@@ -283,7 +283,7 @@ ip6_forward(m, srcrt)
break;
default:
printf("ip6_output (ipsec): error code %d\n", error);
- /* fall through */
+ /* FALLTHROUGH */
case ENOENT:
/* don't show these error codes to the user */
break;
@@ -305,15 +305,14 @@ ip6_forward(m, srcrt)
dst = (struct sockaddr_in6 *)&ip6_forward_rt.ro_dst;
if (!srcrt) {
- /*
- * ip6_forward_rt.ro_dst.sin6_addr is equal to ip6->ip6_dst
- */
+ /* ip6_forward_rt.ro_dst.sin6_addr is equal to ip6->ip6_dst */
if (ip6_forward_rt.ro_rt == 0 ||
(ip6_forward_rt.ro_rt->rt_flags & RTF_UP) == 0) {
if (ip6_forward_rt.ro_rt) {
RTFREE(ip6_forward_rt.ro_rt);
ip6_forward_rt.ro_rt = 0;
}
+
/* this probably fails but give it a try again */
rtalloc_ign((struct route *)&ip6_forward_rt,
RTF_PRCLONING);
@@ -330,7 +329,7 @@ ip6_forward(m, srcrt)
return;
}
} else if ((rt = ip6_forward_rt.ro_rt) == 0 ||
- !IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst, &dst->sin6_addr)) {
+ !IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst, &dst->sin6_addr)) {
if (ip6_forward_rt.ro_rt) {
RTFREE(ip6_forward_rt.ro_rt);
ip6_forward_rt.ro_rt = 0;
@@ -423,7 +422,7 @@ ip6_forward(m, srcrt)
}
m_freem(m);
return;
- }
+ }
if (rt->rt_flags & RTF_GATEWAY)
dst = (struct sockaddr_in6 *)rt->rt_gateway;
@@ -497,11 +496,11 @@ ip6_forward(m, srcrt)
#endif
{
printf("ip6_forward: outgoing interface is loopback. "
- "src %s, dst %s, nxt %d, rcvif %s, outif %s\n",
- ip6_sprintf(&ip6->ip6_src),
- ip6_sprintf(&ip6->ip6_dst),
- ip6->ip6_nxt, if_name(m->m_pkthdr.rcvif),
- if_name(rt->rt_ifp));
+ "src %s, dst %s, nxt %d, rcvif %s, outif %s\n",
+ ip6_sprintf(&ip6->ip6_src),
+ ip6_sprintf(&ip6->ip6_dst),
+ ip6->ip6_nxt, if_name(m->m_pkthdr.rcvif),
+ if_name(rt->rt_ifp));
}
/* we can just use rcvif in forwarding. */
@@ -544,6 +543,7 @@ ip6_forward(m, srcrt)
goto freecopy;
}
}
+
#ifdef PFIL_HOOKS
senderr:
#endif
@@ -551,12 +551,10 @@ senderr:
return;
switch (error) {
case 0:
-#if 1
if (type == ND_REDIRECT) {
icmp6_redirect_output(mcopy, rt);
return;
}
-#endif
goto freecopy;
case EMSGSIZE:
OpenPOWER on IntegriCloud