Skip to content

Commit 65519ab

Browse files
committed
Log unsupported openflow messages but avoid errors
With this commit, the openflow drivers would not return an error when they receive a packet that is not supported. Instead they log the unsupported message.
1 parent 9a717f5 commit 65519ab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

openflow/driver.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ func (d *of10Driver) handlePkt(pkt of.Header, c *ofConn) error {
4747
case of10.IsStatsReply(pkt10):
4848
return d.handleStatsReply(of10.NewStatsReplyWithBuf(pkt10.Buf), c)
4949
default:
50-
return fmt.Errorf("Received unsupported packet: %v", pkt.Type())
50+
glog.Errorf("Received unsupported packet: %v", pkt.Type())
51+
return nil
5152
}
5253
}
5354

@@ -71,7 +72,8 @@ func (d *of12Driver) handlePkt(pkt of.Header, c *ofConn) error {
7172
case of12.IsRoleReply(pkt12):
7273
return d.handleRoleReply(of12.NewRoleReplyWithBuf(pkt12.Buf), c)
7374
default:
74-
return fmt.Errorf("received unsupported packet: %v", pkt.Type())
75+
glog.Errorf("received unsupported packet: %v", pkt.Type())
76+
return nil
7577
}
7678
}
7779

0 commit comments

Comments
 (0)