diff options
Diffstat (limited to 'dev.c')
-rw-r--r-- | dev.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -189,3 +189,24 @@ u32 device_bitrate(const char *ifname) return scopper ? : swireless; } + +short device_enter_promiscuous_mode(const char *ifname) +{ + short ifflags; + + if (!strncmp("any", ifname, strlen("any"))) + return 0; + + ifflags = device_get_flags(ifname); + device_set_flags(ifname, ifflags | IFF_PROMISC); + + return ifflags; +} + +void device_leave_promiscuous_mode(const char *ifname, short oldflags) +{ + if (!strncmp("any", ifname, strlen("any"))) + return; + + device_set_flags(ifname, oldflags); +} |