From 7e2c38de45da65021e4c2874229ff0f0161421e1 Mon Sep 17 00:00:00 2001 From: Kjell Wooding Date: Thu, 10 Aug 2000 15:43:21 +0000 Subject: Whoops. Reapply Aaron's detach code fix. inadvertantly whacked in the 3.3.18 import. --- sys/netinet/ip_nat.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sys/netinet/ip_nat.c') diff --git a/sys/netinet/ip_nat.c b/sys/netinet/ip_nat.c index a6283e04d34..c618c90ff7b 100644 --- a/sys/netinet/ip_nat.c +++ b/sys/netinet/ip_nat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_nat.c,v 1.34 2000/08/10 05:50:26 kjell Exp $ */ +/* $OpenBSD: ip_nat.c,v 1.35 2000/08/10 15:43:20 kjell Exp $ */ /* * Copyright (C) 1995-1998 by Darren Reed. @@ -614,9 +614,9 @@ void nat_ifdetach(ifp) struct ifnet *ifp; { - ipnat_t *n, **np; + ipnat_t *n, **np = &nat_list; - for (np = &nat_list; (n = *np) != NULL; np = &n->in_next) { + while ((n = *np)) { *np = n->in_next; if (!n->in_use) { if (n->in_apr) @@ -627,7 +627,6 @@ nat_ifdetach(ifp) n->in_flags |= IPN_DELETE; n->in_next = NULL; } - n = NULL; } } -- cgit v1.2.3