svn commit: r201012 - user/luigi/ipfw3-head/sys/netinet/ipfw

Luigi Rizzo luigi at FreeBSD.org
Sat Dec 26 02:56:59 UTC 2009


Author: luigi
Date: Sat Dec 26 02:56:58 2009
New Revision: 201012
URL: http://svn.freebsd.org/changeset/base/201012

Log:
  another small simplification

Modified:
  user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_pfil.c

Modified: user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_pfil.c
==============================================================================
--- user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_pfil.c	Sat Dec 26 02:36:48 2009	(r201011)
+++ user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_pfil.c	Sat Dec 26 02:56:58 2009	(r201012)
@@ -46,9 +46,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/lock.h>
 #include <sys/rwlock.h>
 #include <sys/socket.h>
-#include <sys/socketvar.h>
 #include <sys/sysctl.h>
-#include <sys/ucred.h>
 
 #include <net/if.h>
 #include <net/route.h>
@@ -239,7 +237,7 @@ ipfw_check_out(void *arg, struct mbuf **
 	struct ip_fw_args args;
 	struct ng_ipfw_tag *ng_tag;
 	struct m_tag *dn_tag;
-	int ipfw = 0;
+	int ipfw;
 	int divert;
 	int tee;
 #ifdef IPFIREWALL_FORWARD
@@ -392,14 +390,14 @@ ipfw_divert(struct mbuf **m, int incomin
 		goto nodivert;
 
 	/* Cloning needed for tee? */
-	if (tee)
+	if (tee) {
 		clone = m_dup(*m, M_DONTWAIT);
-	else
+		/* In case m_dup was unable to allocate mbufs. */
+		if (clone == NULL)
+			return 0;
+	} else
 		clone = *m;
 
-	/* In case m_dup was unable to allocate mbufs. */
-	if (clone == NULL)
-		goto teeout;
 
 	/*
 	 * Divert listeners can only handle non-fragmented packets.
@@ -445,7 +443,6 @@ ipfw_divert(struct mbuf **m, int incomin
 	if (clone && ip_divert_ptr != NULL)
 		ip_divert_ptr(clone, incoming);
 
-teeout:
 	/*
 	 * For tee we leave the divert tag attached to original packet.
 	 * It will then continue rule evaluation after the tee rule.


More information about the svn-src-user mailing list