From bd10cf56c457bba31c1773466f737bb5a8a373ff Mon Sep 17 00:00:00 2001 From: Alexander Bluhm Date: Wed, 7 Mar 2018 10:15:47 +0100 Subject: [PATCH] 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. --- scapy/arch/unix.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scapy/arch/unix.py b/scapy/arch/unix.py index bd26bc1db..874aaf399 100644 --- a/scapy/arch/unix.py +++ b/scapy/arch/unix.py @@ -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":