Skip to content

Commit

Permalink
Regression with linux interface detection
Browse files Browse the repository at this point in the history
  • Loading branch information
phaethon committed Nov 25, 2015
1 parent 20a7745 commit 72e3e09
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions scapy/arch/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ def get_if_list():
lst.append(l.split(":")[0].strip())
f.close()
return lst
# unused function
# def get_working_if():
# for i in get_if_list():
# if i == LOOPBACK_NAME:
# continue
# ifflags = struct.unpack("16xH14x",get_if(i,SIOCGIFFLAGS))[0]
# if ifflags & IFF_UP:
# return i
# return LOOPBACK_NAME

def get_working_if():
for i in get_if_list():
if i == LOOPBACK_NAME:
continue
ifflags = struct.unpack("16xH14x",get_if(i,SIOCGIFFLAGS))[0]
if ifflags & IFF_UP:
return i
return LOOPBACK_NAME
def attach_filter(s, filter):
# XXX We generate the filter on the interface conf.iface
# because tcpdump open the "any" interface and ppp interfaces
Expand Down

0 comments on commit 72e3e09

Please sign in to comment.