On Thu, Sep 06, 2018 at 09:07:34AM -0600, Klemens Nanni wrote:
>
> CVSROOT: /cvs
> Module name: src
> Changes by: [email protected] 2018/09/06 09:07:34
>
> Modified files:
> sbin/pfctl : parse.y pf_print_state.c pfctl.h
> pfctl_optimize.c pfctl_parser.c pfctl_parser.h
>
> Log message:
> Remove unused af argument from unmask()
>
> This has been unused for years.
>
> While here, zap the duplicate function signature from pfctl.h (already
> present in pfctl_parser.h); spotted by sashan, thanks.
>
> OK sashan
This commit breaks the build:
/usr/src/usr.sbin/tcpdump/pf_print_state.c:107:38: error: too many arguments to
function call, expected 1, have 2
int bits = unmask(&addr->v.a.mask, af);
~~~~~~ ^~
/usr/src/usr.sbin/tcpdump/../../sbin/pfctl/pfctl_parser.h:288:1: note: 'unmask'
declared here
int unmask(struct pf_addr *);
^
/usr/src/usr.sbin/tcpdump/pf_print_state.c:321:1: error: conflicting types for
'unmask'
unmask(struct pf_addr *m, sa_family_t af)
^
/usr/src/usr.sbin/tcpdump/../../sbin/pfctl/pfctl_parser.h:288:8: note: previous
declaration is here
int unmask(struct pf_addr *);
^
Here's the fix, ok?
Index: usr.sbin/tcpdump/pf_print_state.c
===================================================================
RCS file: /cvs/src/usr.sbin/tcpdump/pf_print_state.c,v
retrieving revision 1.13
diff -u -p -u -p -r1.13 pf_print_state.c
--- usr.sbin/tcpdump/pf_print_state.c 28 Oct 2016 12:42:39 -0000 1.13
+++ usr.sbin/tcpdump/pf_print_state.c 7 Sep 2018 07:13:21 -0000
@@ -104,7 +104,7 @@ print_addr(struct pf_addr_wrap *addr, sa
return;
}
if (! PF_AZERO(&addr->v.a.mask, af)) {
- int bits = unmask(&addr->v.a.mask, af);
+ int bits = unmask(&addr->v.a.mask);
if (bits != (af == AF_INET ? 32 : 128))
printf("/%d", bits);
@@ -318,7 +318,7 @@ print_state(struct pfsync_state *s, int
}
int
-unmask(struct pf_addr *m, sa_family_t af)
+unmask(struct pf_addr *m)
{
int i = 31, j = 0, b = 0;
u_int32_t tmp;