From 34a8566f70b193c52629d7fbbdeb3574bd41b100 Mon Sep 17 00:00:00 2001 From: Daniel Hartmeier Date: Tue, 8 Aug 2006 20:05:55 +0000 Subject: properly join host lists in ifa_grouplookup(), closes PR 5195, reported by andrew fresh --- sbin/pfctl/pfctl_parser.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 4f522dcd854..c009f99a4c5 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_parser.c,v 1.226 2006/07/06 13:26:41 henning Exp $ */ +/* $OpenBSD: pfctl_parser.c,v 1.227 2006/08/08 20:05:54 dhartmei Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -1207,7 +1207,7 @@ ifa_grouplookup(const char *ifa_name, int flags) struct ifg_req *ifg; struct ifgroupreq ifgr; int s, len; - struct node_host *n, *h = NULL, *hn; + struct node_host *n, *h = NULL; if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1) err(1, "socket"); @@ -1232,10 +1232,8 @@ ifa_grouplookup(const char *ifa_name, int flags) if (h == NULL) h = n; else { - for (hn = h; hn->next != NULL; hn = hn->next) - ; /* nothing */ - hn->next = n; - n->tail = hn; + h->tail->next = n; + h->tail = n->tail; } } free(ifgr.ifgr_groups); -- cgit v1.2.3