From ca462bcfcbc51b878fd88e0a5c8f61ce0b7e08fb Mon Sep 17 00:00:00 2001 From: Luigi Rizzo Date: Wed, 20 Feb 2002 17:15:57 +0000 Subject: [PATCH] BUGFIX: make use of the pointer to the target of skipto rules, so that after the first time we can follow the pointer instead of having to scan the list. This was the intended behaviour from day one. PR: 34639 MFC-after: 3 days --- sys/netinet/ip_fw.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netinet/ip_fw.c b/sys/netinet/ip_fw.c index 5c6e1555a9a8..01908d79bd30 100644 --- a/sys/netinet/ip_fw.c +++ b/sys/netinet/ip_fw.c @@ -1512,11 +1512,13 @@ ip_fw_chk(struct ip **pip, int hlen, return(f->fw_divert_port | IP_FW_PORT_TEE_FLAG); #endif case IP_FW_F_SKIPTO: /* XXX check */ - f = f->next_rule_ptr ? f->next_rule_ptr : - lookup_next_rule(f) ; + if (f->next_rule_ptr == NULL) + f->next_rule_ptr = lookup_next_rule(f) ; + f = f->next_rule_ptr; if (!f) goto dropit; goto again ; + case IP_FW_F_PIPE: case IP_FW_F_QUEUE: *flow_id = f; /* XXX set flow id */