diff --git a/VERSION b/VERSION index f979adec..bf057dbf 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.9.0 +v0.10.0 diff --git a/ofctrl/ofAction.go b/ofctrl/ofAction.go index a075b4bc..b81bc3b7 100644 --- a/ofctrl/ofAction.go +++ b/ofctrl/ofAction.go @@ -657,21 +657,29 @@ type NXController struct { UserData []byte MeterID uint32 Pause bool + MaxLen *uint16 } func (a *NXController) GetActionMessage() openflow15.Action { + // By default, do not buffer, i.e., send the full packet to the controller. + // Note that OVS does not support buffering and always sends the full + // packet; it will ignore other values of max_len. + maxLen := uint16(openflow15.OFPCML_NO_BUFFER) + if a.MaxLen != nil { + maxLen = *a.MaxLen + } if a.Version2 { action := openflow15.NewNXActionController2() action.AddControllerID(a.ControllerID) action.AddReason(a.Reason) action.AddUserdata(a.UserData) - action.AddMaxLen(128) + action.AddMaxLen(maxLen) action.AddMeterID(a.MeterID) action.AddPause(a.Pause) return action } action := openflow15.NewNXActionController(a.ControllerID) - action.MaxLen = 128 + action.MaxLen = maxLen action.Reason = a.Reason return action } diff --git a/ofctrl/ofpacket_test.go b/ofctrl/ofpacket_test.go index 311e236d..7e5832c3 100644 --- a/ofctrl/ofpacket_test.go +++ b/ofctrl/ofpacket_test.go @@ -148,7 +148,7 @@ func TestNxOutputAndSendController(t *testing.T) { flow1.Send(openflow15.FC_ADD) verifyFlowInstallAndDelete(t, flow1, NewEmptyElem(), brName, table0.TableId, "priority=100,ip,dl_src=11:22:33:44:55:66", - fmt.Sprintf("output:NXM_NX_REG0[],controller(max_len=128,id=%d)", app.Switch.ctrlID)) + fmt.Sprintf("output:NXM_NX_REG0[],controller(id=%d)", app.Switch.ctrlID)) } func testPacketInOut(t *testing.T, ofApp *packetApp, ipv6 bool, reason uint8, controllerV2 bool, dstPort uint16, userData []byte, pause bool) {