Skip to content

Make bf_pktpy the default PTF module. - #236

Open
fruffy wants to merge 1 commit into
mainfrom
fruffy/switch_pkt_default
Open

fruffy wants to merge 1 commit into
mainfrom
fruffy/switch_pkt_default

Conversation

@fruffy

@fruffy fruffy commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Resolve the issues that we provide the GPL scapy module with PTF.

@fruffy fruffy added the breaking-change This change may break assumptions of downstream dependencies. label Apr 8, 2026

@jafingerhut jafingerhut left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hereby resolve to not mention again that backwards compatibility is very nice thing to preserve. :-)

@fruffy

fruffy commented Apr 9, 2026

Copy link
Copy Markdown
Contributor Author

I hereby resolve to not mention again that backwards compatibility is very nice thing to preserve. :-)

Anyone that wants to keep using scapy can still do so by switching the module. We can also still add the warning and have one or two releases display it until we pull the trigger. Now with a consistent release cycle this really should not be a problem.

@fruffy
fruffy force-pushed the fruffy/switch_pkt_default branch from 27b19b5 to cad1806 Compare June 23, 2026 01:51
@jafingerhut

jafingerhut commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

I hereby resolve to not mention again that backwards compatibility is very nice thing to preserve. :-)

While I won't mention the above again, I will request that when this is merged, that we increase the major version number of this package, e.g. to version 1.0.0, which by my understanding of semantic versioning is the signal that there are backwards-incompatible breaking changes in that version.

@jafingerhut

jafingerhut commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

I have looked the CI test failures, an experimenting locally to see if I can find changes that enable them to pass.

At the moment, all I think that I have learned is that the call stack of the failure includes the line exp_pkt.set_do_not_care_packet(Ether, "dst") in file test.py. It gets slightly further if you replace that line with:

exp_pkt.set_do_not_care_packet(ptf.packet.Ether, "dst")

However, then it still fails with this exception:

AttributeError: 'Ether' object has no attribute 'fields'

because that is part of what method _calculate_fields_offset_and_bitwidth in file mask.py is trying to do. That code seems to rely upon attributes of class Ether that Scapy defines, but bf_pktpy does not.

This is part of the "deep and wide" nature of Scapy that I pointed out earlier -- even ptf's implementation has parts in it that rely on Scapy, that not even the bf_pktpy implementers bothered to reimplement.

We could disable that test, but if we do, we should probably disable the set_do_not_care_packet method in ptf, too (or perhaps figure out a fancy way to disable it with bf_pktpy, but enable it if you are using Scapy).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change This change may break assumptions of downstream dependencies.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants