summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2006-05-29 15:48:47 +0000
committerHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2006-05-29 15:48:47 +0000
commit04f5868d39125a3aa3c03fceba36def051b0cd2c (patch)
tree379f61ad864a5177f7ed9e6a28f90694144acfed /sbin
parentd643d6ce577d12b49b5324f8921f9feff5a51f84 (diff)
As the rule expansion is now aware of host lists, host_if() has to
return a proper list of addresses bound to an interface.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ipsecctl/parse.y16
1 files changed, 12 insertions, 4 deletions
diff --git a/sbin/ipsecctl/parse.y b/sbin/ipsecctl/parse.y
index 2c3c186786a..db747578876 100644
--- a/sbin/ipsecctl/parse.y
+++ b/sbin/ipsecctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.75 2006/05/29 15:22:40 hshoexer Exp $ */
+/* $OpenBSD: parse.y,v 1.76 2006/05/29 15:48:46 hshoexer Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1425,7 +1425,7 @@ ifa_grouplookup(const char *ifa_name)
struct ipsec_addr_wrap *
ifa_lookup(const char *ifa_name)
{
- struct ipsec_addr_wrap *ipa = NULL, *p = NULL;
+ struct ipsec_addr_wrap *ipa = NULL, *p = NULL, *h = NULL;
if (iftab == NULL)
ifa_load();
@@ -1445,10 +1445,18 @@ ifa_lookup(const char *ifa_name)
if ((ipa->name = strdup(p->name)) == NULL)
err(1, "ifa_lookup: strdup");
set_ipmask(ipa, 32);
- break;
+
+ ipa->next = NULL;
+ ipa->tail = ipa;
+ if (h == NULL)
+ h = ipa;
+ else {
+ h->tail->next = ipa;
+ h->tail = ipa;
+ }
}
- return (ipa);
+ return (h);
}
void