From: guy Date: Fri, 2 May 2003 08:37:43 +0000 (+0000) Subject: The value pointed to by "gen_pf_ifname()"'s argument isn't modified, so X-Git-Tag: libpcap-0.8-bp~41 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/2e69dd906a9660f1bf4ed5a85d06d3b89114fb0e The value pointed to by "gen_pf_ifname()"'s argument isn't modified, so make it a const pointer. Cast the interface name in the "gen_bcmp()" call in "gen_pf_ifname()" to squelch a compiler warning. --- diff --git a/gencode.c b/gencode.c index 5e1aeedf..f8765fb5 100644 --- a/gencode.c +++ b/gencode.c @@ -21,7 +21,7 @@ */ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.190 2003-03-28 08:09:48 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.191 2003-05-02 08:37:43 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -4976,7 +4976,7 @@ gen_inbound(dir) /* PF firewall log matched interface */ struct block * -gen_pf_ifname(char *ifname) +gen_pf_ifname(const char *ifname) { if (linktype != DLT_PFLOG) { bpf_error("ifname supported only for DLT_PFLOG"); @@ -4986,7 +4986,7 @@ gen_pf_ifname(char *ifname) bpf_error("ifname interface names can't be larger than 16 characters"); /* NOTREACHED */ } - return (gen_bcmp(4, strlen(ifname), ifname)); + return (gen_bcmp(4, strlen(ifname), (const u_char *)ifname)); } diff --git a/gencode.h b/gencode.h index 441995e6..c3a19a77 100644 --- a/gencode.h +++ b/gencode.h @@ -18,7 +18,7 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * @(#) $Header: /tcpdump/master/libpcap/gencode.h,v 1.57 2003-03-11 06:23:53 guy Exp $ (LBL) + * @(#) $Header: /tcpdump/master/libpcap/gencode.h,v 1.58 2003-05-02 08:37:44 guy Exp $ (LBL) */ /* @@ -278,7 +278,7 @@ struct block *gen_atmfield_code(int atmfield, bpf_u_int32 jvalue, bpf_u_int32 jt struct block *gen_atmtype_abbrev(int type); struct block *gen_atmmulti_abbrev(int type); -struct block *gen_pf_ifname(char *); +struct block *gen_pf_ifname(const char *); struct block *gen_pf_rnr(int); struct block *gen_pf_reason(int); struct block *gen_pf_action(int);