diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-03-29 04:30:05 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-03-29 04:30:05 +0000 |
commit | e0e8900edd558055eb0b812dbec6e51523fffe84 (patch) | |
tree | bf43d66f2d18f0dbddcde3fa9ebc43cfee53e198 /package/network/services/ead/src/ead.c | |
parent | 86841522d58d81a31f0aed3e1539dcf2cdbfe54a (diff) | |
download | mtk-20170518-e0e8900edd558055eb0b812dbec6e51523fffe84.zip mtk-20170518-e0e8900edd558055eb0b812dbec6e51523fffe84.tar.gz mtk-20170518-e0e8900edd558055eb0b812dbec6e51523fffe84.tar.bz2 |
ead: clean up, fix musl build
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 45110
Diffstat (limited to 'package/network/services/ead/src/ead.c')
-rw-r--r-- | package/network/services/ead/src/ead.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/package/network/services/ead/src/ead.c b/package/network/services/ead/src/ead.c index d1847c1..bded769 100644 --- a/package/network/services/ead/src/ead.c +++ b/package/network/services/ead/src/ead.c @@ -30,19 +30,17 @@ #include <t_sha.h> #include <t_defines.h> #include <t_server.h> +#include <net/if.h> #include "list.h" #include "ead.h" #include "ead-pcap.h" #include "ead-crypt.h" +#include "libbridge.h" #include "filter.c" #ifdef linux -#include "libbridge_init.c" -#endif - -#ifdef linux #include <linux/if_packet.h> #endif @@ -74,10 +72,8 @@ struct ead_instance { char ifname[16]; int pid; char id; -#ifdef linux char bridge[16]; bool br_check; -#endif }; static char ethmac[6] = "\x00\x13\x37\x00\x00\x00"; /* last 3 bytes will be randomized */ @@ -696,13 +692,10 @@ ead_pcap_reopen(bool first) pcap_fp_rx = NULL; do { -#ifdef linux if (instance->bridge[0]) { pcap_fp_rx = ead_open_pcap(instance->bridge, errbuf, 1); pcap_fp = ead_open_pcap(instance->ifname, errbuf, 0); - } else -#endif - { + } else { pcap_fp = ead_open_pcap(instance->ifname, errbuf, 1); } @@ -836,7 +829,6 @@ server_handle_sigint(int sig) exit(1); } -#ifdef linux static int check_bridge_port(const char *br, const char *port, void *arg) { @@ -866,12 +858,10 @@ check_bridge(const char *name, void *arg) br_foreach_port(name, check_bridge_port, arg); return 0; } -#endif static void check_all_interfaces(void) { -#ifdef linux struct ead_instance *in; struct list_head *p; @@ -889,7 +879,6 @@ check_all_interfaces(void) stop_server(in, false); } } -#endif } @@ -973,9 +962,7 @@ int main(int argc, char **argv) nid = *(((u16_t *) ethmac) + 2); start_servers(false); -#ifdef linux br_init(); -#endif tv.tv_sec = 1; tv.tv_usec = 0; while (1) { @@ -983,9 +970,7 @@ int main(int argc, char **argv) start_servers(true); sleep(1); } -#ifdef linux br_shutdown(); -#endif return 0; } |