ead: fix bridge handling mistakes

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13846 3c298f89-4303-0410-b956-a3cf2f4a3e73
master
Felix Fietkau 2009-01-04 00:21:24 +00:00
parent 170e9b2abe
commit 8997d76472
1 changed files with 5 additions and 6 deletions

View File

@ -622,22 +622,21 @@ ead_pcap_reopen(bool first)
{ {
static char errbuf[PCAP_ERRBUF_SIZE] = ""; 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); pcap_close(pcap_fp_rx);
if (pcap_fp) if (pcap_fp)
pcap_close(pcap_fp); pcap_close(pcap_fp);
pcap_fp_rx = pcap_fp; pcap_fp_rx = NULL;
do { do {
pcap_fp = pcap_open_live(ifname, PCAP_MRU, 1, PCAP_TIMEOUT, errbuf); pcap_fp = pcap_open_live(ifname, PCAP_MRU, 1, PCAP_TIMEOUT, errbuf);
#ifdef linux #ifdef linux
if (brname) { if (brname)
pcap_fp_rx = pcap_open_live(brname, PCAP_MRU, 1, PCAP_TIMEOUT, errbuf); pcap_fp_rx = pcap_open_live(brname, PCAP_MRU, 1, PCAP_TIMEOUT, errbuf);
if (!pcap_fp_rx)
pcap_fp_rx = pcap_fp;
}
#endif #endif
if (!pcap_fp_rx)
pcap_fp_rx = pcap_fp;
pcap_setfilter(pcap_fp_rx, &pktfilter); pcap_setfilter(pcap_fp_rx, &pktfilter);
if (first && !pcap_fp) { if (first && !pcap_fp) {
DEBUG(1, "WARNING: unable to open interface '%s'\n", ifname); DEBUG(1, "WARNING: unable to open interface '%s'\n", ifname);