summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_input.c
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2012-11-02 01:20:55 +0000
committerae <ae@FreeBSD.org>2012-11-02 01:20:55 +0000
commit4354018055d167b2dd190c0ed81b74972a32fe2c (patch)
tree3080b551004723e63a6f3fe08ee72e510038fe57 /sys/netinet/ip_input.c
parent99cf02c7fdbbd005e93ef256cbf128c446cd2ee8 (diff)
downloadFreeBSD-src-4354018055d167b2dd190c0ed81b74972a32fe2c.zip
FreeBSD-src-4354018055d167b2dd190c0ed81b74972a32fe2c.tar.gz
Remove the recently added sysctl variable net.pfil.forward.
Instead, add protocol specific mbuf flags M_IP_NEXTHOP and M_IP6_NEXTHOP. Use them to indicate that the mbuf's chain contains the PACKET_TAG_IPFORWARD tag. And do a tag lookup only when this flag is set. Suggested by: andre
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r--sys/netinet/ip_input.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index e0e98a2..033c03d 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -509,23 +509,22 @@ tooshort:
dchg = (odst.s_addr != ip->ip_dst.s_addr);
ifp = m->m_pkthdr.rcvif;
- if (V_pfilforward == 0)
- goto passin;
-
if (m->m_flags & M_FASTFWD_OURS) {
m->m_flags &= ~M_FASTFWD_OURS;
goto ours;
}
- if ((dchg = (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL)) != 0) {
- /*
- * Directly ship the packet on. This allows forwarding
- * packets originally destined to us to some other directly
- * connected host.
- */
- ip_forward(m, dchg);
- return;
+ if (m->m_flags & M_IP_NEXTHOP) {
+ dchg = (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL);
+ if (dchg != 0) {
+ /*
+ * Directly ship the packet on. This allows
+ * forwarding packets originally destined to us
+ * to some other directly connected host.
+ */
+ ip_forward(m, 1);
+ return;
+ }
}
-
passin:
/*
OpenPOWER on IntegriCloud