diff options
author | Daniel Hartmeier <dhartmei@cvs.openbsd.org> | 2006-08-08 20:05:55 +0000 |
---|---|---|
committer | Daniel Hartmeier <dhartmei@cvs.openbsd.org> | 2006-08-08 20:05:55 +0000 |
commit | 34a8566f70b193c52629d7fbbdeb3574bd41b100 (patch) | |
tree | 3f30a27636d721e9330b612343454c4dafc2a74d /sbin/pfctl | |
parent | 98902c9e1498a29cc563e4da072ab18ccc0cbdde (diff) |
properly join host lists in ifa_grouplookup(), closes PR 5195,
reported by andrew fresh
Diffstat (limited to 'sbin/pfctl')
-rw-r--r-- | sbin/pfctl/pfctl_parser.c | 10 |
1 files 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); |