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 9b5f652 commit 16dc529Copy full SHA for 16dc529
1 file changed
scapy/layers/hsrp.py
@@ -296,11 +296,19 @@ def post_build(self, p, pay):
296
297
bind_bottom_up(UDP, HSRP, dport=1985)
298
bind_bottom_up(UDP, HSRP, sport=1985)
299
-bind_bottom_up(UDP, HSRP, dport=2029)
300
-bind_bottom_up(UDP, HSRP, sport=2029)
301
bind_layers(UDP, HSRP, dport=1985, sport=1985)
302
-bind_layers(UDP, HSRP, dport=2029, sport=2029)
+
303
DestIPField.bind_addr(UDP, "224.0.0.2", dport=1985)
+"""
+since port 1954 (UDP) would be shared by both hsrpv1 and hsprv2 (ipv4),
304
+users building hsrpv2 (ipv4) packets should set IP(dst="224.0.0.102") explicitly to avoid using wrong multicast destination
305
306
+# DestIPField.bind_addr(UDP, "224.0.0.102", dport=1985)
307
308
if conf.ipv6_enabled:
309
from scapy.layers.inet6 import DestIP6Field
310
311
+ bind_bottom_up(UDP, HSRPv2, dport=2029)
312
+ bind_bottom_up(UDP, HSRPv2, sport=2029)
313
+ bind_layers(UDP, HSRPv2, dport=2029, sport=2029)
314
DestIP6Field.bind_addr(UDP, "ff02::66", dport=2029)
0 commit comments