Permalink
Browse files

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.
  • Loading branch information...
yuguy committed May 2, 2003
1 parent fdbc702 commit 2e69dd906a9660f1bf4ed5a85d06d3b89114fb0e
Showing with 5 additions and 5 deletions.
  1. +3 −3 gencode.c
  2. +2 −2 gencode.h
View
@@ -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));
}
View
@@ -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);

0 comments on commit 2e69dd9

Please sign in to comment.