e10dfcf357
When secchan is configured to "fail open" after failing to connect to a controller for a period of time, it needs a heuristic for what constitutes a successful connection. Until now, that heuristic was simply that when it received an OpenFlow message from the controller (any OpenFlow message), it considered the connection successful. However, this is no longer good enough, because NOX performs admission control on connections after sending a number of OpenFlow messages, in particular after doing OpenFlow version negotiation and requesting the switch features (and receiving the reply). Thus, this commit adjusts the heuristic by only considering certain OpenFlow messages to demonstrate that admission control checks have passed and thus that the connection should be considered successful. As a fallback, any connection that persists for 30 seconds or longer is also considered successful. An alternate and complementary approach (that this commit does not implement) would be to use an OpenFlow error message to indicate why the connection is closing. Fixes bug #239.