diff options
author | 2002-11-30 10:07:51 +0000 | |
---|---|---|
committer | 2002-11-30 10:07:51 +0000 | |
commit | 6a718e6c786bf9968011f16ecb8b201e6ef3b99c (patch) | |
tree | 9e3708095f74253ac912e3d6c9b8c70b1c318678 | |
parent | sync (diff) | |
download | wireguard-openbsd-6a718e6c786bf9968011f16ecb8b201e6ef3b99c.tar.xz wireguard-openbsd-6a718e6c786bf9968011f16ecb8b201e6ef3b99c.zip |
move unmask back into pf_print_state.c where it was, and please keep it there; henning@ ok
-rw-r--r-- | sbin/pfctl/pf_print_state.c | 24 | ||||
-rw-r--r-- | sbin/pfctl/pfctl_parser.c | 24 |
2 files changed, 24 insertions, 24 deletions
diff --git a/sbin/pfctl/pf_print_state.c b/sbin/pfctl/pf_print_state.c index cb3c56f4449..be1c930d10b 100644 --- a/sbin/pfctl/pf_print_state.c +++ b/sbin/pfctl/pf_print_state.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_print_state.c,v 1.12 2002/11/29 18:24:29 mickey Exp $ */ +/* $OpenBSD: pf_print_state.c,v 1.13 2002/11/30 10:07:51 mickey Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -224,3 +224,25 @@ print_state(struct pf_state *s, int opts) printf("\n"); } } + +int +unmask(struct pf_addr *m, sa_family_t af) +{ + int i = 31, j = 0, b = 0, msize; + u_int32_t tmp; + + if (af == AF_INET) + msize = 1; + else + msize = 4; + while (j < msize && m->addr32[j] == 0xffffffff) { + b += 32; + j++; + } + if (j < msize) { + tmp = ntohl(m->addr32[j]); + for (i = 31; tmp & (1 << i); --i) + b++; + } + return (b); +} diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 72a9bd930be..80261b69c0d 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_parser.c,v 1.114 2002/11/28 13:18:09 mcbride Exp $ */ +/* $OpenBSD: pfctl_parser.c,v 1.115 2002/11/30 10:07:51 mickey Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -888,25 +888,3 @@ parse_flags(char *s) } return (f ? f : PF_TH_ALL); } - -int -unmask(struct pf_addr *m, sa_family_t af) -{ - int i = 31, j = 0, b = 0, msize; - u_int32_t tmp; - - if (af == AF_INET) - msize = 1; - else - msize = 4; - while (j < msize && m->addr32[j] == 0xffffffff) { - b += 32; - j++; - } - if (j < msize) { - tmp = ntohl(m->addr32[j]); - for (i = 31; tmp & (1 << i); --i) - b++; - } - return (b); -} |