We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 40fc5ec commit 140ba64Copy full SHA for 140ba64
scapy/layers/inet.py
@@ -586,6 +586,8 @@ def route(self):
586
if conf.route is None:
587
# unused import, only to initialize conf.route
588
import scapy.route # noqa: F401
589
+ if not isinstance(dst, (str, bytes, int)):
590
+ dst = str(dst)
591
return conf.route.route(dst, dev=scope)
592
593
def hashret(self):
test/scapy/layers/inet.uts
@@ -92,6 +92,12 @@ pkts = sniff(offline=pkts, session=IPSession)
92
assert len(pkts) == 2
93
assert pkts[1].load == b"X" * 1500
94
95
+= IPSession - summary with RandIP() does not crash
96
+
97
+pkt = IP(dst=RandIP())
98
+s = pkt.summary()
99
+assert isinstance(s, str)
100
101
= StringBuffer
102
103
buffer = StringBuffer()
0 commit comments