diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2002-12-05 15:28:01 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2002-12-05 15:28:01 +0000 |
commit | 1ca3b0a8f3d1deb2bc64d114656001e3511cd505 (patch) | |
tree | 19588652f38bf99489722b29cd83368517a713bf | |
parent | 5b02e404c24d963f81bb8327d8581baf6cf6fc76 (diff) |
fix a small cosmetic problem. if ifa_lookup was called in LOOKUP_NET mode,
it would return things like 127.0.0.1/8. when 127.0.0.1/8 is passed through
the new selftests, it becomes 127.0.0.0/8.
fix: instead of just copying addr.mask in ifa_lookup, use set_ipmask, so it
is 127.0.0.0/8 from the beginning on.
-rw-r--r-- | sbin/pfctl/parse.y | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 43e923a547b..1ed17e8819b 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.235 2002/12/05 13:07:24 henning Exp $ */ +/* $OpenBSD: parse.y,v 1.236 2002/12/05 15:28:00 henning Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -3566,8 +3566,7 @@ ifa_lookup(char *ifa_name, enum pfctl_iflookup_mode mode) memcpy(&n->addr.addr, &p->addr.addr, sizeof(struct pf_addr)); if (mode == PFCTL_IFLOOKUP_NET) - memcpy(&n->addr.mask, &p->addr.mask, - sizeof(struct pf_addr)); + set_ipmask(n, unmask(&p->addr.mask, n->af)); else { if (n->af == AF_INET) { if (p->ifa_flags & IFF_LOOPBACK && |