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

Multipart message from controller in role slave #11

Open
nygge opened this issue Dec 19, 2012 · 0 comments
Open

Multipart message from controller in role slave #11

nygge opened this issue Dec 19, 2012 · 0 comments

Comments

@nygge
Copy link
Contributor

nygge commented Dec 19, 2012

A controller in role slave is not allowed to perform actions that changes the state of the switch.
Version 1.3.1, ch 6.3.4 page 30 it says about controllers with role=slave

"The controller is denied the ability to execute controller-to-switch commands that modify the state of the switch, OFPT_PACKET_OUT, OFPT_FLOW_MOD, OFPT_GROUP_MOD, OFPT_PORT_MOD and OFPT_TABLE_MOD. If the controller sends one of those commands, the switch must reply with an OFPT_ERROR message with a type field of OFPET_BAD_REQUEST, a code field of OFPBRC_IS_SLAVE. Other controller-to-switch messages, such as OFPT_MULTIPART_REQUEST and OFPT_ROLE_REQUEST, should be processed normally."

This is not completely correct. The multipart subcommand table_features can be used to modify the switch. So it is necessary to add something like

handle_message(#ofp_message{
version = Version, type = multipart_request,
body = #ofp_table_features_request{ body = Body }} = Message,
#state{role = slave} = State) when Body /= [] ->
%% Don't allow slave controllers to modify things.
Error = create_error(Version, bad_request, is_slave),
IsSlaveError = Message#ofp_message{body = Error},
do_send(IsSlaveError, State);

to ofp_client. But this is not possible since ofp_client is version agnostic, so the #ofp_table_features record is not available.

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

No branches or pull requests

1 participant