From: kn Date: Fri, 7 Sep 2018 12:43:30 +0000 (+0000) Subject: Remove unnused af argument from unmask(), sync with pfctl X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=eaa84e12e5c2e2ea09ddd107fca03bcc6209561f;p=openbsd Remove unnused af argument from unmask(), sync with pfctl Noted by jca, thanks. OK jca claudio --- diff --git a/sbin/ipsecctl/ipsecctl.c b/sbin/ipsecctl/ipsecctl.c index 60b25d5c111..3b218d4d08e 100644 --- a/sbin/ipsecctl/ipsecctl.c +++ b/sbin/ipsecctl/ipsecctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipsecctl.c,v 1.83 2017/11/20 10:51:24 mpi Exp $ */ +/* $OpenBSD: ipsecctl.c,v 1.84 2018/09/07 12:43:30 kn Exp $ */ /* * Copyright (c) 2004, 2005 Hans-Joerg Hoexer * @@ -64,7 +64,7 @@ void ipsecctl_show_sas(int); int ipsecctl_monitor(int); void usage(void); const char *ipsecctl_lookup_option(char *, const char **); -static int unmask(struct ipsec_addr *, sa_family_t); +static int unmask(struct ipsec_addr *); int sacompare(const void *, const void *); const char *showopt; @@ -400,7 +400,7 @@ ipsecctl_print_addr(struct ipsec_addr_wrap *ipa) else printf("%s", buf); - bits = unmask(&ipa->mask, ipa->af); + bits = unmask(&ipa->mask); if (bits != (ipa->af == AF_INET ? 32 : 128)) printf("/%d", bits); } @@ -902,9 +902,8 @@ main(int argc, char *argv[]) exit(error); } -/* ARGSUSED1 */ static int -unmask(struct ipsec_addr *ipa, sa_family_t af) +unmask(struct ipsec_addr *ipa) { int i = 31, j = 0, b = 0; u_int32_t tmp; diff --git a/usr.bin/systat/pftop.c b/usr.bin/systat/pftop.c index 1420184c58e..2326d080dd9 100644 --- a/usr.bin/systat/pftop.c +++ b/usr.bin/systat/pftop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pftop.c,v 1.41 2018/02/08 07:00:33 martijn Exp $ */ +/* $OpenBSD: pftop.c,v 1.42 2018/09/07 12:43:30 kn Exp $ */ /* * Copyright (c) 2001, 2007 Can Erkin Acar * Copyright (c) 2001 Daniel Hartmeier @@ -694,20 +694,16 @@ read_states(void) } int -unmask(struct pf_addr * m, u_int8_t af) +unmask(struct pf_addr * m) { - int i = 31, j = 0, b = 0, msize; + int i = 31, j = 0, b = 0; u_int32_t tmp; - if (af == AF_INET) - msize = 1; - else - msize = 4; - while (j < msize && m->addr32[j] == 0xffffffff) { + while (j < 4 && m->addr32[j] == 0xffffffff) { b += 32; j++; } - if (j < msize) { + if (j < 4) { tmp = ntohl(m->addr32[j]); for (i = 31; tmp & (1 << i); --i) b++; @@ -733,7 +729,7 @@ tb_print_addr(struct pf_addr * addr, struct pf_addr * mask, int af) if (mask != NULL) { if (!PF_AZERO(mask, af)) - tbprintf("/%u", unmask(mask, af)); + tbprintf("/%u", unmask(mask)); } }