From: Tobias Klauser Date: Fri, 9 Aug 2013 09:43:52 +0000 (+0200) Subject: promisc: Constify `ifname' parameters to {enter,leave}_promiscuous_mode() X-Git-Tag: v0.5.8-rc3~22 X-Git-Url: https://repo.or.cz/w/netsniff-ng.git/commitdiff_plain/af0c1f5f89750f16054c988937e180764c411c20 promisc: Constify `ifname' parameters to {enter,leave}_promiscuous_mode() The parameter `ifname' to {enter,leave}_promiscuous_mode() is never modified inside the functions, thus mark it as const. Signed-off-by: Tobias Klauser --- diff --git a/promisc.c b/promisc.c index 32184b12..56f6e4be 100644 --- a/promisc.c +++ b/promisc.c @@ -5,7 +5,7 @@ #include "promisc.h" #include "dev.h" -short enter_promiscuous_mode(char *ifname) +short enter_promiscuous_mode(const char *ifname) { short ifflags; @@ -18,7 +18,7 @@ short enter_promiscuous_mode(char *ifname) return ifflags; } -void leave_promiscuous_mode(char *ifname, short oldflags) +void leave_promiscuous_mode(const char *ifname, short oldflags) { if (!strncmp("any", ifname, strlen("any"))) return; diff --git a/promisc.h b/promisc.h index b290b929..3dc275f8 100644 --- a/promisc.h +++ b/promisc.h @@ -1,7 +1,7 @@ #ifndef PROMISC_H #define PROMISC_H -extern short enter_promiscuous_mode(char *ifname); -extern void leave_promiscuous_mode(char *ifname, short oldflags); +extern short enter_promiscuous_mode(const char *ifname); +extern void leave_promiscuous_mode(const char *ifname, short oldflags); #endif /* PROMISC_H */