diff options
author | Matthew Smith <mgsmith@netgate.com> | 2020-02-11 11:25:32 -0600 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2020-02-13 19:46:30 +0000 |
commit | 39e9428b90bc74d1bb15fc17759c8ef6ad712418 (patch) | |
tree | de9317a906a7df43bf2140a654d3b7675cab8d86 /test/patches/scapy-2.4.3 | |
parent | f75defa7676759fa81ae75e7edd492572c6b8fd6 (diff) |
vrrp: add plugin providing vrrp support
Type: feature
Add a new plugin to support HA using VRRPv3 (RFC 5798).
Change-Id: Iaa2c37e6172f8f41e9165f178f44d481f6e247b9
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Diffstat (limited to 'test/patches/scapy-2.4.3')
-rw-r--r-- | test/patches/scapy-2.4.3/vrrp.patch | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/patches/scapy-2.4.3/vrrp.patch b/test/patches/scapy-2.4.3/vrrp.patch new file mode 100644 index 00000000000..39e99d4045e --- /dev/null +++ b/test/patches/scapy-2.4.3/vrrp.patch @@ -0,0 +1,35 @@ +diff --git a/scapy/layers/vrrp.py b/scapy/layers/vrrp.py +index 1b583653..3d6a5923 100644 +--- a/scapy/layers/vrrp.py ++++ b/scapy/layers/vrrp.py +@@ -10,7 +10,7 @@ VRRP (Virtual Router Redundancy Protocol). + + from scapy.packet import Packet, bind_layers + from scapy.fields import BitField, ByteField, FieldLenField, FieldListField, \ +- IPField, IntField, XShortField ++ IPField, IP6Field, IntField, MultipleTypeField, StrField, XShortField + from scapy.compat import chb, orb + from scapy.layers.inet import IP, in4_chksum, checksum + from scapy.layers.inet6 import IPv6, in6_chksum +@@ -62,9 +62,18 @@ class VRRPv3(Packet): + BitField("res", 0, 4), + BitField("adv", 100, 12), + XShortField("chksum", None), +- # FIXME: addrlist should also allow IPv6 addresses :/ +- FieldListField("addrlist", [], IPField("", "0.0.0.0"), +- count_from=lambda pkt: pkt.ipcount)] ++ MultipleTypeField( ++ [ ++ (FieldListField("addrlist", [], IPField("", "0.0.0.0"), ++ count_from=lambda pkt: pkt.ipcount), ++ lambda p: isinstance(p.underlayer, IP)), ++ (FieldListField("addrlist", [], IP6Field("", "::"), ++ count_from=lambda pkt: pkt.ipcount), ++ lambda p: isinstance(p.underlayer, IPv6)), ++ ], ++ StrField("addrlist", "") ++ ) ++ ] + + def post_build(self, p, pay): + if self.chksum is None: |