Skip to content

Commit

Permalink
tests: Change a duplicate field name in a prm struct
Browse files Browse the repository at this point in the history
[ Upstream commit d5196ff ]

This fixes the following warning that the latest scapy versions return:
" SyntaxWarning: Packet 'FlowTableEntryMatchSetLyr24' has a duplicated
'reserved' field ! If you are using several ConditionalFields, have a
look at MultipleTypeField instead ! This will become a SyntaxError in a
future version of Scapy !"

In this case though, it's not a duplicate name of multi-fields, but two
reserved fields.

Fixes: 1e71fbc ("tests: Add FlowTableEntryMatchParam class")
Signed-off-by: Edward Srouji <edwards@nvidia.com>
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
  • Loading branch information
EdwardSro authored and nmorey committed May 25, 2022
1 parent fa2fafb commit 47fa40f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/mlx5_prm_structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1192,15 +1192,15 @@ class FlowTableEntryMatchSetLyr24(Packet):
# Field names must be different
ConditionalField(BitField('src_ip_mask', 0, 128),
lambda pkt: pkt.ip_version != 4 and pkt.ip_version != 6),
ConditionalField(BitField('reserved', 0, 96),
ConditionalField(BitField('reserved2', 0, 96),
lambda pkt: pkt.ip_version == 4),
ConditionalField(IPField("src_ip4", "0.0.0.0"),
lambda pkt: pkt.ip_version == 4),
ConditionalField(IP6Field("src_ip6", "::"),
lambda pkt: pkt.ip_version == 6),
ConditionalField(BitField('dst_ip_mask', 0, 128),
lambda pkt: pkt.ip_version != 4 and pkt.ip_version != 6),
ConditionalField(BitField('reserved', 0, 96),
ConditionalField(BitField('reserved3', 0, 96),
lambda pkt: pkt.ip_version == 4),
ConditionalField(IPField("dst_ip4", "0.0.0.0"),
lambda pkt: pkt.ip_version == 4),
Expand Down

0 comments on commit 47fa40f

Please sign in to comment.