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

#ofp_bucket's watch_port and watch_group fields not handling constants properly #60

Open
ZoltanLajosKis opened this issue Nov 22, 2013 · 0 comments

Comments

@ZoltanLajosKis
Copy link
Member

The watch_port should be set to OFPP_ANY ('any' atom), and watch_group should be set to OFPG_ANY ('any' atom) when the field is to be ignored. However the current #ofp_bucket{} record definition default these fields to zero (which btw. is an invalid value for ports).

Also these fields are not handled by the enums, so upon decoding the fields will not be converted to atoms for constants, and on encoding the use of constants result in an error:

ofp_v4_encode:do(#ofp_message{version=4, type=group_mod, body=#ofp_group_mod{command=add, type=ff, group_id=1, buckets=[#ofp_bucket{watch_port=any}]}}).
** exception error: bad argument
in function ofp_v4_encode:encode_struct/1 (src/ofp_v4_encode.erl, line 317)
in call from ofp_utils:encode_list/3 (src/ofp_utils.erl, line 139)
in call from ofp_v4_encode:encode_body/1 (src/ofp_v4_encode.erl, line 544)
in call from ofp_v4_encode:do/1 (src/ofp_v4_encode.erl, line 37)

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