author | mjm <mjm> | 2002-12-28 12:59:38 (UTC) |
---|---|---|
committer | mjm <mjm> | 2002-12-28 12:59:38 (UTC) |
commit | 1adf0d153cd8c4714719183af45ed703abef0a43 (patch) (side-by-side diff) | |
tree | 8845f1bbee4d050a18a6e5fa970bb5adaa277bc0 /noncore/net/wellenreiter/libwellenreiter | |
parent | 7a6a55d19048de7920eb885e80a26e1bef0f66e4 (diff) | |
download | opie-1adf0d153cd8c4714719183af45ed703abef0a43.zip opie-1adf0d153cd8c4714719183af45ed703abef0a43.tar.gz opie-1adf0d153cd8c4714719183af45ed703abef0a43.tar.bz2 |
cleanup
Diffstat (limited to 'noncore/net/wellenreiter/libwellenreiter') (more/less context) (ignore whitespace changes)
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 @@ -22,3 +22,3 @@ int card_into_monitormode (pcap_t **orighandle, char *device, int cardtype) - /* Setting the prmiscous and up flag to the interface */ + /* Setting the promiscous and up flag to the interface */ if (!card_set_promisc_up(device)) @@ -66,3 +66,3 @@ int card_set_promisc_up (const char *device) { - char ifconfigcmd[32]; + char ifconfigcmd[48]; int retval=0; @@ -72,6 +72,3 @@ int card_set_promisc_up (const char *device) - if(retval != 0) - return 0; - -return 1; + return (retval ? 0 : 1); } 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 @@ -126,3 +126,7 @@ void process_packets(const struct pcap_pkthdr *pkthdr, const unsigned char *pack - send_network_found((char *)guihost, guiport, &wl_net); + if(!send_network_found((char *)guihost, guiport, &wl_net)) + { + wl_logerr("Error sending data to UI: %s", strerror(errno)); + break; + } wl_loginfo("Sent network to GUI '%s:%d'", guihost, guiport); 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 @@ -37,6 +37,7 @@ int get_field(const char *buffer, char *out) - return atoi(len) + 3; + /* Return length of whole field (including 3 byte length) */ + return (atoi(len) + 3); } -/* Send found network to GUI */ +/* Send found network to UI */ int send_network_found (const char *guihost, int guiport, void *structure) @@ -77,3 +78,3 @@ int send_network_found (const char *guihost, int guiport, void *structure) /* Set Mac */ - retval = add_field(buffer + len, (char *)ptr->mac, 17); + retval = add_field(buffer + len, ptr->mac, 17); len += retval; @@ -81,12 +82,10 @@ int send_network_found (const char *guihost, int guiport, void *structure) /* Set ssid */ - retval = add_field(buffer + len, (char *)ptr->bssid, ptr->ssid_len); + retval = add_field(buffer + len, ptr->bssid, ptr->ssid_len); - /* Send prepared buffer to GUI */ + /* Send prepared buffer to UI */ #ifdef DEBUG - wl_loginfo("Sending network to GUI: '%s'", buffer); + wl_loginfo("Sending network to UI: '%s'", buffer); #endif - wl_send(guihost, guiport, buffer); - - return 1; + return ((!wl_send(guihost, guiport, buffer)) ? 0 : 1); } 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 @@ -58,3 +58,3 @@ int wl_send(const char *host, int port, const char *string, ...) wl_logerr("Cannot set up socket: %s", strerror(errno)); - return -1; + return 0; } @@ -65,3 +65,3 @@ int wl_send(const char *host, int port, const char *string, ...) close(sock); - return -1; + return 0; } @@ -71,3 +71,3 @@ int wl_send(const char *host, int port, const char *string, ...) - return 0; + return 1; } |