summaryrefslogtreecommitdiff
path: root/package/ead
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2009-01-04 00:21:24 +0000
committerFelix Fietkau <nbd@openwrt.org>2009-01-04 00:21:24 +0000
commit6bb52080b451a44a71353bbb068226e3da3a6f97 (patch)
tree2cdefeb9a5be6b373baec7059578c01a8acc2bc8 /package/ead
parent3f8c4c8439b49d982a25b82adfc8be04620fd2d5 (diff)
downloadmtk-20170518-6bb52080b451a44a71353bbb068226e3da3a6f97.zip
mtk-20170518-6bb52080b451a44a71353bbb068226e3da3a6f97.tar.gz
mtk-20170518-6bb52080b451a44a71353bbb068226e3da3a6f97.tar.bz2
ead: fix bridge handling mistakes
SVN-Revision: 13846
Diffstat (limited to 'package/ead')
-rw-r--r--package/ead/src/ead.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/package/ead/src/ead.c b/package/ead/src/ead.c
index c4d3dd9..b6a9310 100644
--- a/package/ead/src/ead.c
+++ b/package/ead/src/ead.c
@@ -622,22 +622,21 @@ ead_pcap_reopen(bool first)
{
static char errbuf[PCAP_ERRBUF_SIZE] = "";
- if (pcap_fp_rx != pcap_fp)
+ if (pcap_fp_rx && (pcap_fp_rx != pcap_fp))
pcap_close(pcap_fp_rx);
if (pcap_fp)
pcap_close(pcap_fp);
- pcap_fp_rx = pcap_fp;
+ pcap_fp_rx = NULL;
do {
pcap_fp = pcap_open_live(ifname, PCAP_MRU, 1, PCAP_TIMEOUT, errbuf);
#ifdef linux
- if (brname) {
+ if (brname)
pcap_fp_rx = pcap_open_live(brname, PCAP_MRU, 1, PCAP_TIMEOUT, errbuf);
- if (!pcap_fp_rx)
- pcap_fp_rx = pcap_fp;
- }
#endif
+ if (!pcap_fp_rx)
+ pcap_fp_rx = pcap_fp;
pcap_setfilter(pcap_fp_rx, &pktfilter);
if (first && !pcap_fp) {
DEBUG(1, "WARNING: unable to open interface '%s'\n", ifname);