NetBSD Problem Report #54028

From martin@duskware.de  Fri Mar  1 11:09:11 2019
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id EAC257A17C
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  1 Mar 2019 11:09:11 +0000 (UTC)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: net/scapy not working?
X-Send-Pr-Version: 3.95

>Number:         54028
>Category:       pkg
>Synopsis:       net/scapy not working?
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gutteridge
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 01 11:10:01 +0000 2019
>Closed-Date:    
>Last-Modified:  Tue Nov 05 02:28:26 +0000 2019
>Originator:     Martin Husemann
>Release:        NetBSD 8.99.34
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD space-truckin.duskware.de 8.99.34 NetBSD 8.99.34 (SUNXI) #33: Tue Feb 26 07:40:08 CET 2019 martin@night-owl.duskware.de:/usr/src/sys/arch/evbarm/compile/SUNXI evbarm
Architecture: earmv7hfeb
Machine: evbarm
>Description:

I was trying to run a python script from a recentish FreeBSD test case
commit and could not make it work. It does soemthing along the lines of:

import scapy.all as sp


def main():
    intf = sys.argv[1]
    ipv6_src = sys.argv[2]
    ipv6_dst = sys.argv[3]

    ipv6_main = sp.IPv6(dst=ipv6_dst, src=ipv6_src)
[...]
    sp.sendp(pkt0, iface=intf, verbose=False)


I have scapy-2.3.2 from pkgsrc, and I called the test script with:

# python2.7 test.py awge0 2001:470:1f0b:e84:a982:4f01:4b81:7d8a 2001:470:a085:999::80


(where awge0 is my only ethernet interface, the first address is my local
IPv6 and the second is www.netbsd.org).

Scapy failed to send the packet:
WARNING: No route found for IPv6 destination 2001:470:a085:999::80 (no default route?)

which is plain wrong, I can do:

> ping6 -S 2001:470:1f0b:e84:a982:4f01:4b81:7d8a 2001:470:a085:999::80
PING6(56=40+8+8 bytes) 2001:470:1f0b:e84:a982:4f01:4b81:7d8a --> 2001:470:a085:999::80
16 bytes from 2001:470:a085:999::80, icmp_seq=0 hlim=54 time=156.987 ms
16 bytes from 2001:470:a085:999::80, icmp_seq=1 hlim=54 time=155.625 ms

>How-To-Repeat:
s/a

>Fix:
n/a

>Release-Note:

>Audit-Trail:
From: Aymeric Vincent <aymericvincent@free.fr>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/54028
Date: Thu, 28 Mar 2019 18:59:31 +0100

 Hi,

 could you please obtain the output of the following snippet?

 from scapy.arch import read_routes6
 for r in read_routes6():
     print r

 and see if it matches the output of netstat -rn -f inet6? On BSD, scapy
 parses the output of netstat to determine its routing table. It seems to
 work for me on -current, but I don't use IPv6 so I tried only with
 link-local addresses. :-/

 Regards,
  Aymeric

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/54028
Date: Thu, 28 Mar 2019 20:15:43 +0100

 Script output:

 ('::', 104, '::', 'lo0', ['::1'])
 ('::', 96, '::', 'lo0', ['::1'])
 ('::1', 128, '::', 'lo0', ['::1'])
 ('::127.0.0.0', 104, '::', 'lo0', ['::1'])
 ('::224.0.0.0', 100, '::', 'lo0', ['::1'])
 ('::255.0.0.0', 104, '::', 'lo0', ['::1'])
 ('::ffff:0.0.0.0', 96, '::', 'lo0', ['::1'])
 ('2001:470:1f0b:e84:a982:4f01:4b81:7d8a', 128, '::', 'lo0', ['::1'])
 ('2001:db8::', 32, '::', 'lo0', ['::1'])
 ('2002::', 24, '::', 'lo0', ['::1'])
 ('2002:7f00::', 24, '::', 'lo0', ['::1'])
 ('2002:e000::', 20, '::', 'lo0', ['::1'])
 ('2002:ff00::', 24, '::', 'lo0', ['::1'])
 ('fe80::', 10, '::', 'lo0', ['::1'])
 ('fe80::', 64, '::', 'awge0', ['fe80::9a43:96ac:a66b:d416'])
 ('fe80::9a43:96ac:a66b:d416', 128, '::', 'lo0', ['::1'])
 ('fe80::', 64, '::', 'lo0', ['::1'])
 ('fe80::1', 128, '::', 'lo0', ['::1'])
 ('ff01:1::', 32, '::', 'awge0', ['::1'])
 ('ff01:2::', 32, '::', 'lo0', ['::1'])
 ('ff02::', 32, '::', 'awge0', ['fe80::9a43:96ac:a66b:d416'])
 ('ff02::', 32, '::', 'lo0', ['::1'])


 netstat output:


 Routing tables

 Internet6:
 Destination                             Gateway                        Flags    Refs      Use    Mtu Interface
 ::/104                                  ::1                            UGRS        -        -  33176  lo0
 ::/96                                   ::1                            UGRS        -        -  33176  lo0
 default                                 fe80::464e:6dff:fe87:a0c8      UGS         -        -   1480  awge0
 ::1                                     lo0                            UHl         -        -  33176  lo0
 ::127.0.0.0/104                         ::1                            UGRS        -        -  33176  lo0
 ::224.0.0.0/100                         ::1                            UGRS        -        -  33176  lo0
 ::255.0.0.0/104                         ::1                            UGRS        -        -  33176  lo0
 ::ffff:0.0.0.0/96                       ::1                            UGRS        -        -  33176  lo0
 2001:470:1f0b:e84::/64                  link#1                         UCS         -        -   1480  awge0
 2001:470:1f0b:e84:a982:4f01:4b81:7d8a   link#1                         UHl         -        -      -  lo0
 2001:db8::/32                           ::1                            UGRS        -        -  33176  lo0
 2002::/24                               ::1                            UGRS        -        -  33176  lo0
 2002:7f00::/24                          ::1                            UGRS        -        -  33176  lo0
 2002:e000::/20                          ::1                            UGRS        -        -  33176  lo0
 2002:ff00::/24                          ::1                            UGRS        -        -  33176  lo0
 fe80::/10                               ::1                            UGRS        -        -  33176  lo0
 fe80::%awge0/64                         link#1                         UC          -        -      -  awge0
 fe80::9a43:96ac:a66b:d416               link#1                         UHl         -        -      -  lo0
 fe80::%lo0/64                           fe80::1                        U           -        -      -  lo0
 fe80::1                                 lo0                            UHl         -        -      -  lo0
 ff01:1::/32                             link#1                         UC          -        -      -  awge0
 ff01:2::/32                             ::1                            UC          -        -  33176  lo0
 ff02::%awge0/32                         link#1                         UC          -        -      -  awge0
 ff02::%lo0/32                           ::1                            UC          -        -  33176  lo0


 Martin

State-Changed-From-To: open->feedback
State-Changed-By: gutteridge@NetBSD.org
State-Changed-When: Mon, 04 Nov 2019 06:06:49 +0000
State-Changed-Why:
I've updated to a newer version of scapy, could you please re-test with it?

From: "David H. Gutteridge" <david@gutteridge.ca>
To: martin@netbsd.org, gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/54028 (net/scapy not working?)
Date: Mon, 04 Nov 2019 01:32:59 -0500

 On Mon, 2019-11-04 at 06:06 +0000, gutteridge@NetBSD.org wrote:
 > Synopsis: net/scapy not working?
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: gutteridge@NetBSD.org
 > State-Changed-When: Mon, 04 Nov 2019 06:06:49 +0000
 > State-Changed-Why:
 > I've updated to a newer version of scapy, could you please re-test
 > with it?

 Something I should add: having tested it in various environments, I just
 realized I hadn't tested it with Python 2.7. Naturally, it has a PLIST
 issue with 2.7... So 3.6 or 3.7 are the viable ones, for now.

 Dave


From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/54028 (net/scapy not working?)
Date: Mon, 4 Nov 2019 12:24:08 +0100

 I have update all pkgs on the machine, python is now 3.7.

 # scapy
 INFO: Can't import matplotlib. Won't be able to plot.
 INFO: Can't import PyX. Won't be able to use psdump() or pdfdump().
 WARNING: No route found for IPv6 destination :: (no default route?)
 INFO: Can't import python-cryptography v1.7+. Disabled WEP decryption/encryption. (Dot11)
 INFO: Can't import python-cryptography v1.7+. Disabled IPsec encryption/authentication.
 WARNING: IPython not available. Using standard Python shell instead.
 AutoCompletion, History are disabled.

                      aSPY//YASa       
              apyyyyCY//////////YCa       |
             sY//////YSpcs  scpCY//Pp     | Welcome to Scapy
  ayp ayyyyyyySCP//Pp           syY//C    | Version git-archive.dev304758016
  AYAsAYYYYYYYY///Ps              cY//S   |
          pCCCCY//p          cSSps y//Y   | https://github.com/secdev/scapy
          SPPPP///a          pP///AC//Y   |
               A//A            cyP////C   | Have fun!
               p///Ac            sC///a   |
               P////YCpc           A//A   | Craft me if you can.
        scccccp///pSP///p          p//Y   |                   -- IPv6 layer
       sY/////////y  caa           S//P   |
        cayCyayP//Ya              pY/Ya
         sY/PsY////YCc          aC//Yp 
          sc  sccaCY//PCypaapyCP//YSs  
                   spCPY//////YPSps    
                        ccaacs         

 >>> 


 Note the warning about the IPv6 default route

 Most comands in scapy do not work (missing modules). Doing "ls()" works though.

 Martin

State-Changed-From-To: feedback->open
State-Changed-By: gutteridge@NetBSD.org
State-Changed-When: Tue, 05 Nov 2019 02:25:37 +0000
State-Changed-Why:
Feedback received.

Responsible-Changed-From-To: pkg-manager->gutteridge
Responsible-Changed-By: gutteridge@NetBSD.org
Responsible-Changed-When: Tue, 05 Nov 2019 02:28:26 +0000
Responsible-Changed-Why:
Take.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.