Ticket #135 (closed defect: fixed)

Opened 4 months ago

Last modified 4 months ago

Incorrect route table parsing on Solaris with VPN

Reported by: andras.lipoth@gmail.com Assigned to: pbi
Priority: minor Milestone:
Component: Scapy Version:
Keywords: route solaris netstat vpn Cc:

Description

On Solaris 'netstat -rvn' can output lines without device name:

$ netstat -rvn

IRE Table: IPv4
  Destination             Mask           Gateway          Device Mxfrg Rtt   Ref Flg  Out  In/Fwd
-------------------- --------------- -------------------- ------ ----- ----- --- --- ----- ------
default              0.0.0.0         XXX.XX.XX.X          nge0    1500*    0   1 UG  447732      0
10.45.0.0            255.255.255.0   10.45.0.31                   1500*    0   1 UG      13      0
10.45.0.31           255.255.255.255 10.45.0.30           tun0    1500*    0   1 UH       0      0
XXX.XX.0.0           255.255.128.0   XXX.XX.XXX.XXX       nge0    1500*    0   1 U    45979      0
192.168.2.0          255.255.255.0   10.45.0.31                   1500*    0   1 UG     292      0
192.168.3.0          255.255.255.0   192.168.3.1          nge1    1500*    0   1 U    45551      0
192.168.4.0          255.255.255.0   10.45.0.31                   1500*    0   1 UG       0      0
192.168.5.0          255.255.255.0   10.45.0.31                   1500*    0   1 UG       0      0
224.0.0.0            240.0.0.0       192.168.3.1          nge1    1500*    0   1 U        0      0
127.0.0.1            255.255.255.255 127.0.0.1            lo0     8232*    0   1 UH  787835      0

When Scapy parses the output it will end up with '1500*' as interface name and raise 'OSError: No such device or address' from get_if_raw_addr() in source:scapy/arch/pcapdnet.py

An easy fix for the problem is to use 'netstat -rvn -f outif:any' in source:scapy/arch/unix.py, to list only routes with devices assigned.

$ netstat -rvn -f outif:any

IRE Table: IPv4
  Destination             Mask           Gateway          Device Mxfrg Rtt   Ref Flg  Out  In/Fwd
-------------------- --------------- -------------------- ------ ----- ----- --- --- ----- ------
default              0.0.0.0         XXX.XX.XX.X          nge0    1500*    0   1 UG  447732      0
10.45.0.31           255.255.255.255 10.45.0.30           tun0    1500*    0   1 UH       0      0
XXX.XX.0.0           255.255.128.0   XXX.XX.XXX.XXX       nge0    1500*    0   1 U    45980      0
192.168.3.0          255.255.255.0   192.168.3.1          nge1    1500*    0   1 U    45553      0
224.0.0.0            240.0.0.0       192.168.3.1          nge1    1500*    0   1 U        0      0
127.0.0.1            255.255.255.255 127.0.0.1            lo0     8232*    0   1 UH  787883      0

Attachments

Change History

09/12/08 14:03:44 changed by pbi

  • status changed from new to closed.
  • resolution set to fixed.

The proposed fix loose all routes without interfaces.

Fixed in [0c387ff526c8]


Add/Change #135 (Incorrect route table parsing on Solaris with VPN)




Change Properties
Action