4 files changed, 19 insertions, 19 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 | |||
@@ -21,5 +21,5 @@ int card_into_monitormode (pcap_t **orighandle, char *device, int cardtype) | |||
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 | { |
@@ -65,5 +65,5 @@ int card_into_monitormode (pcap_t **orighandle, char *device, int cardtype) | |||
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 | ||
@@ -71,7 +71,4 @@ int card_set_promisc_up (const char *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 | } |
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc b/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc index e2169ca..9b4e360 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc +++ b/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc | |||
@@ -125,5 +125,9 @@ void process_packets(const struct pcap_pkthdr *pkthdr, const unsigned char *pack | |||
125 | memcpy(wl_net.mac, pinfoptr->sndhwaddr, sizeof(wl_net.mac)-1);; | 125 | memcpy(wl_net.mac, pinfoptr->sndhwaddr, sizeof(wl_net.mac)-1);; |
126 | 126 | ||
127 | send_network_found((char *)guihost, guiport, &wl_net); | 127 | if(!send_network_found((char *)guihost, guiport, &wl_net)) |
128 | { | ||
129 | wl_logerr("Error sending data to UI: %s", strerror(errno)); | ||
130 | break; | ||
131 | } | ||
128 | wl_loginfo("Sent network to GUI '%s:%d'", guihost, guiport); | 132 | wl_loginfo("Sent network to GUI '%s:%d'", guihost, guiport); |
129 | } | 133 | } |
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc b/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc index f15523f..5317f52 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc +++ b/noncore/net/wellenreiter/libwellenreiter/source/wl_proto.cc | |||
@@ -36,8 +36,9 @@ int get_field(const char *buffer, char *out) | |||
36 | memcpy(out, buffer + 3, atoi(len)); | 36 | memcpy(out, buffer + 3, atoi(len)); |
37 | 37 | ||
38 | return atoi(len) + 3; | 38 | /* Return length of whole field (including 3 byte length) */ |
39 | return (atoi(len) + 3); | ||
39 | } | 40 | } |
40 | 41 | ||
41 | /* Send found network to GUI */ | 42 | /* Send found network to UI */ |
42 | int send_network_found (const char *guihost, int guiport, void *structure) | 43 | int send_network_found (const char *guihost, int guiport, void *structure) |
43 | { | 44 | { |
@@ -76,18 +77,16 @@ int send_network_found (const char *guihost, int guiport, void *structure) | |||
76 | 77 | ||
77 | /* Set Mac */ | 78 | /* Set Mac */ |
78 | retval = add_field(buffer + len, (char *)ptr->mac, 17); | 79 | retval = add_field(buffer + len, ptr->mac, 17); |
79 | len += retval; | 80 | len += retval; |
80 | 81 | ||
81 | /* Set ssid */ | 82 | /* Set ssid */ |
82 | retval = add_field(buffer + len, (char *)ptr->bssid, ptr->ssid_len); | 83 | retval = add_field(buffer + len, ptr->bssid, ptr->ssid_len); |
83 | 84 | ||
84 | /* Send prepared buffer to GUI */ | 85 | /* Send prepared buffer to UI */ |
85 | #ifdef DEBUG | 86 | #ifdef DEBUG |
86 | wl_loginfo("Sending network to GUI: '%s'", buffer); | 87 | wl_loginfo("Sending network to UI: '%s'", buffer); |
87 | #endif | 88 | #endif |
88 | 89 | ||
89 | wl_send(guihost, guiport, buffer); | 90 | return ((!wl_send(guihost, guiport, buffer)) ? 0 : 1); |
90 | |||
91 | return 1; | ||
92 | } | 91 | } |
93 | 92 | ||
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/wl_sock.cc b/noncore/net/wellenreiter/libwellenreiter/source/wl_sock.cc index 5714afb..4942fba 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/wl_sock.cc +++ b/noncore/net/wellenreiter/libwellenreiter/source/wl_sock.cc | |||
@@ -57,5 +57,5 @@ int wl_send(const char *host, int port, const char *string, ...) | |||
57 | { | 57 | { |
58 | wl_logerr("Cannot set up socket: %s", strerror(errno)); | 58 | wl_logerr("Cannot set up socket: %s", strerror(errno)); |
59 | return -1; | 59 | return 0; |
60 | } | 60 | } |
61 | 61 | ||
@@ -64,5 +64,5 @@ int wl_send(const char *host, int port, const char *string, ...) | |||
64 | wl_logerr("Cannot write to socket: %s", strerror(errno)); | 64 | wl_logerr("Cannot write to socket: %s", strerror(errno)); |
65 | close(sock); | 65 | close(sock); |
66 | return -1; | 66 | return 0; |
67 | } | 67 | } |
68 | 68 | ||
@@ -70,5 +70,5 @@ int wl_send(const char *host, int port, const char *string, ...) | |||
70 | wl_logerr("Cannot close socket: %s", strerror(errno)); | 70 | wl_logerr("Cannot close socket: %s", strerror(errno)); |
71 | 71 | ||
72 | return 0; | 72 | return 1; |
73 | } | 73 | } |
74 | 74 | ||