Handle OpenBSD routes with locked MTU.

In OpenBSD the MTU value of a route may be locked.  This is indicated
by an ' L' in the netstat -r output.  For scapy's read_routes()
this looks like an additional column.  Make the parser aware of
this possibility when finding the network interface.
This commit is contained in:
Alexander Bluhm 2018-03-07 10:15:47 +01:00
parent 71c23dafef
commit bd10cf56c4
1 changed files with 2 additions and 1 deletions

View File

@ -78,7 +78,8 @@ def read_routes():
else:
rt = l.split()
dest,gw,flg = rt[:3]
netif = rt[4 + mtu_present + prio_present + refs_present]
locked = OPENBSD and rt[6] == "L"
netif = rt[4 + mtu_present + prio_present + refs_present + locked]
if flg.find("Lc") >= 0:
continue
if dest == "default":