patch-2.2.13 linux/net/ipv4/ip_masq_portfw.c

Next file: linux/net/ipv4/ip_masq_user.c
Previous file: linux/net/ipv4/ip_masq_mfw.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.12/linux/net/ipv4/ip_masq_portfw.c linux/net/ipv4/ip_masq_portfw.c
@@ -2,7 +2,7 @@
  *		IP_MASQ_PORTFW masquerading module
  *
  *
- *	$Id: ip_masq_portfw.c,v 1.3.2.1 1999/07/02 10:10:02 davem Exp $
+ *	$Id: ip_masq_portfw.c,v 1.3.2.2 1999/08/13 18:26:29 davem Exp $
  *
  * Author:	Steven Clarke <steven.clarke@monmouth.demon.co.uk>
  *
@@ -85,7 +85,8 @@
 				(!laddr || n->laddr == laddr) &&
 				(!raddr || n->raddr == raddr) && 
 				(!rport || n->rport == rport)) {
-			list_del(entry);
+			entry = n->list.prev;
+			list_del(&n->list);
 			ip_masq_mod_dec_nent(mmod_self);
 			kfree_s(n, sizeof(struct ip_portfw));
 			MOD_DEC_USE_COUNT;
@@ -422,14 +423,14 @@
 				raddr, rport,
 				iph->saddr, portp[0],
 				0);
-		ip_masq_listen(ms);
-
 		if (!ms || atomic_read(&mmod_self->mmod_nent) <= 1 
 			/* || ip_masq_nlocks(&portfw_lock) != 1 */ )
 				/*
 				 *	Maybe later...
 				 */
 				goto out;
+
+		ip_masq_listen(ms);
 
 		/*
 		 *	Entry created, lock==1.

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)