Diffstat (limited to 'noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc index c29f4d0..7362f14 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc +++ b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc | |||
@@ -17,13 +17,13 @@ int card_into_monitormode (pcap_t **orighandle, char *device, int cardtype) | |||
17 | if(device == NULL) | 17 | if(device == NULL) |
18 | { | 18 | { |
19 | wl_logerr("No device given"); | 19 | wl_logerr("No device given"); |
20 | return 0; | 20 | return 0; |
21 | } | 21 | } |
22 | 22 | ||
23 | /* Setting the prmiscous and up flag to the interface */ | 23 | /* Setting the promiscous and up flag to the interface */ |
24 | if (!card_set_promisc_up(device)) | 24 | if (!card_set_promisc_up(device)) |
25 | { | 25 | { |
26 | wl_logerr("Cannot set interface to promisc mode: %s", strerror(errno)); | 26 | wl_logerr("Cannot set interface to promisc mode: %s", strerror(errno)); |
27 | return 0; | 27 | return 0; |
28 | } | 28 | } |
29 | wl_loginfo("Interface set to promisc mode"); | 29 | wl_loginfo("Interface set to promisc mode"); |
@@ -61,17 +61,14 @@ int card_into_monitormode (pcap_t **orighandle, char *device, int cardtype) | |||
61 | return 1; | 61 | return 1; |
62 | } | 62 | } |
63 | 63 | ||
64 | /* Set card into promisc mode */ | 64 | /* Set card into promisc mode */ |
65 | int card_set_promisc_up (const char *device) | 65 | int card_set_promisc_up (const char *device) |
66 | { | 66 | { |
67 | char ifconfigcmd[32]; | 67 | char ifconfigcmd[48]; |
68 | int retval=0; | 68 | int retval=0; |
69 | 69 | ||
70 | snprintf(ifconfigcmd, sizeof(ifconfigcmd) - 1, SBIN_PATH, device); | 70 | snprintf(ifconfigcmd, sizeof(ifconfigcmd) - 1, SBIN_PATH, device); |
71 | retval = system(ifconfigcmd); | 71 | retval = system(ifconfigcmd); |
72 | 72 | ||
73 | if(retval != 0) | 73 | return (retval ? 0 : 1); |
74 | return 0; | ||
75 | |||
76 | return 1; | ||
77 | } | 74 | } |