Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bmv2 JSON config files can have duplicates in header_types section #674

Closed
jafingerhut opened this issue May 27, 2017 · 0 comments
Closed

Comments

@jafingerhut
Copy link
Contributor

switch.p4's bmv2 JSON config file, for example, has several header_types that are repeated 2 or 3 times. I am not sure, but I think this occurs when more than one header has the same type, e.g. if there is an inner IPv4 header and an outer IPv4 header defined with the same type.

The waste of space in the bmv2 JSON file is not my primary concern here. In the "headers" section, the "header_type" is given as a name, not an id, so this means that bmv2 code must have a way to look up the header_type by name, not id. There are other memory corruption issues when there are name collisions in the JSON config file, e.g. #486

I do not know whether behavioral-model code can cause memory corruption while reading such files, but why risk it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant