Skip to content
Snippets Groups Projects
Commit bbc8c3aa authored by Ryan Izard's avatar Ryan Izard
Browse files

Patch channel handler to allow Brocade's 2nd hello. We now allow sw_hello,...

Patch channel handler to allow Brocade's 2nd hello. We now allow sw_hello, ctrl_hello, sw_hello assuming the second sw_hello's protocol version matches what we calculated. If it doesn't, then it might not be the brocade but instead an unsupported switch trying to reconnect (although this should resultin a new socket being established and a new channel handler being instantiated).
parent 75138e85
No related branches found
No related tags found
No related merge requests found
......@@ -341,6 +341,32 @@ class OFChannelHandler extends IdleStateAwareChannelHandler {
setState(new CompleteState());
}
@Override
void processOFHello(OFHello m) throws IOException {
/*
* Brocade switches send a second hello after
* the controller responds with its hello. This
* might be to confirm the protocol version used,
* but isn't defined in the OF specification.
*
* We will ignore such hello messages assuming
* the version of the hello is correct according
* to the algorithm in the spec (pick lowest).
*
* TODO Brocade also sets the XID of this second
* hello as the same XID the controller used.
* Checking for this might help to assure we're
* really dealing with the situation we think
* we are.
*/
if (m.getVersion().equals(factory.getVersion())) {
log.warn("Ignoring second hello in state {}. Might be a Brocade.", state.toString());
} else {
super.processOFHello(m); /* Versions don't match as they should; abort */
}
}
@Override
void enterState() throws IOException {
sendFeaturesRequest();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment