Skip to content

Commit

Permalink
Fixes an issue in OpenFlow 1.2 hanshake
Browse files Browse the repository at this point in the history
We need to flush OF12 connections similar to OF10 to make sure the
handshake is fully done.
  • Loading branch information
soheilhy committed May 13, 2015
1 parent fcee5eb commit 99fa387
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions openflow/echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func doHandleEchoRequest(req of.Header, res of.Header, c *ofConn) error {
if err != nil {
return err
}
c.Flush()
glog.V(2).Infof("Sent echo reply to %v", c.node)
return nil
}
6 changes: 4 additions & 2 deletions openflow/handshake.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ func (c *ofConn) handshake() (ofDriver, error) {
return nil, err
}

glog.V(2).Info("%v received hello from a switch", c.ctx)
glog.V(2).Info("%v received hello from a switch with OFv%v", c.ctx,
h.Version())

version := of.OPENFLOW_1_0
if h.Version() > uint8(of.OPENFLOW_1_2) {
if h.Version() >= uint8(of.OPENFLOW_1_2) {
version = of.OPENFLOW_1_2
}
h.SetVersion(uint8(version))
Expand Down Expand Up @@ -133,6 +134,7 @@ func (d *of12Driver) handshake(c *ofConn) error {
if err := c.WriteHeader(freq.Header); err != nil {
return err
}
c.Flush()

glog.V(2).Info("Sent features request to the switch")

Expand Down

0 comments on commit 99fa387

Please sign in to comment.