aboutsummaryrefslogtreecommitdiff
path: root/sys/net/bridge.c
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2005-01-14 09:00:46 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2005-01-14 09:00:46 +0000
commit6c69a7c30bc2f61a118872b99806ffa23f0108e8 (patch)
treed9fa7d7031281028b0d46da348135c088236c843 /sys/net/bridge.c
parente50508df66f4ebfe70ec03c6858b821fc2029260 (diff)
downloadsrc-6c69a7c30bc2f61a118872b99806ffa23f0108e8.tar.gz
src-6c69a7c30bc2f61a118872b99806ffa23f0108e8.zip
o Clean up interface between ip_fw_chk() and its callers:
- ip_fw_chk() returns action as function return value. Field retval is removed from args structure. Action is not flag any more. It is one of integer constants. - Any action-specific cookies are returned either in new "cookie" field in args structure (dummynet, future netgraph glue), or in mbuf tag attached to packet (divert, tee, some future action). o Convert parsing of return value from ip_fw_chk() in ipfw_check_{in,out}() to a switch structure, so that the functions are more readable, and a future actions can be added with less modifications. Approved by: andre MFC after: 2 months
Notes
Notes: svn path=/head/; revision=140224
Diffstat (limited to 'sys/net/bridge.c')
-rw-r--r--sys/net/bridge.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/net/bridge.c b/sys/net/bridge.c
index 101f752dc7a6..3a4b7aaac4cd 100644
--- a/sys/net/bridge.c
+++ b/sys/net/bridge.c
@@ -1073,12 +1073,14 @@ bdg_forward(struct mbuf *m0, struct ifnet *dst)
if (m0 != NULL)
EH_RESTORE(m0); /* restore Ethernet header */
- if ( (i & IP_FW_PORT_DENY_FLAG) || m0 == NULL) /* drop */
+ if (i == IP_FW_DENY) /* drop */
return m0;
+ KASSERT(m0 != NULL, ("bdg_forward: m0 is NULL"));
+
if (i == 0) /* a PASS rule. */
goto forward;
- if (DUMMYNET_LOADED && (i & IP_FW_PORT_DYNT_FLAG)) {
+ if (DUMMYNET_LOADED && (i == IP_FW_DUMMYNET)) {
/*
* Pass the pkt to dummynet, which consumes it.
* If shared, make a copy and keep the original.
@@ -1095,7 +1097,7 @@ bdg_forward(struct mbuf *m0, struct ifnet *dst)
}
args.oif = real_dst;
- ip_dn_io_ptr(m, (i & 0xffff),DN_TO_BDG_FWD, &args);
+ ip_dn_io_ptr(m, args.cookie, DN_TO_BDG_FWD, &args);
return m0;
}
/*