Skip to content

Commit bd10cf5

Browse files
committed
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.
1 parent 71c23da commit bd10cf5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

scapy/arch/unix.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ def read_routes():
7878
else:
7979
rt = l.split()
8080
dest,gw,flg = rt[:3]
81-
netif = rt[4 + mtu_present + prio_present + refs_present]
81+
locked = OPENBSD and rt[6] == "L"
82+
netif = rt[4 + mtu_present + prio_present + refs_present + locked]
8283
if flg.find("Lc") >= 0:
8384
continue
8485
if dest == "default":

0 commit comments

Comments
 (0)