@@ -1218,11 +1218,9 @@ type NXActionLearn struct {
12181218 Cookie uint64
12191219 Flags uint16
12201220 TableID uint8
1221- pad uint8
12221221 FinIdleTimeout uint16
12231222 FinHardTimeout uint16
12241223 LearnSpecs []* NXLearnSpec
1225- pad2 []byte
12261224}
12271225
12281226func (a * NXActionLearn ) Len () uint16 {
@@ -1252,7 +1250,9 @@ func (a *NXActionLearn) MarshalBinary() (data []byte, err error) {
12521250 binary .BigEndian .PutUint16 (data [n :], a .Flags )
12531251 n += 2
12541252 data [n ] = a .TableID
1255- n += 2
1253+ n += 1
1254+ // 1 byte for padding
1255+ n += 1
12561256 binary .BigEndian .PutUint16 (data [n :], a .FinIdleTimeout )
12571257 n += 2
12581258 binary .BigEndian .PutUint16 (data [n :], a .FinHardTimeout )
@@ -1364,7 +1364,6 @@ func NewNXActionNote() *NXActionNote {
13641364type NXActionRegLoad2 struct {
13651365 * NXActionHeader
13661366 DstField * MatchField
1367- pad []byte
13681367}
13691368
13701369func NewNXActionRegLoad2 (dstField * MatchField ) * NXActionRegLoad2 {
@@ -1417,7 +1416,6 @@ type NXActionController struct {
14171416 MaxLen uint16
14181417 ControllerID uint16
14191418 Reason uint8
1420- pad uint8
14211419}
14221420
14231421func (a * NXActionController ) Len () uint16 {
@@ -1487,7 +1485,6 @@ const (
14871485type NXActionController2PropMaxLen struct {
14881486 * PropHeader /* Type: NXAC2PT_MAX_LEN */
14891487 MaxLen uint16
1490- pad [2 ]uint8
14911488}
14921489
14931490func (a * NXActionController2PropMaxLen ) Len () uint16 {
@@ -1539,7 +1536,6 @@ func NewMaxLen(maxLen uint16) *NXActionController2PropMaxLen {
15391536type NXActionController2PropControllerID struct {
15401537 * PropHeader /* Type: NXAC2PT_CONTROLLER_ID */
15411538 ControllerID uint16
1542- pad [2 ]uint8
15431539}
15441540
15451541func (a * NXActionController2PropControllerID ) Len () uint16 {
@@ -1591,7 +1587,6 @@ func NewControllerID(controllerID uint16) *NXActionController2PropControllerID {
15911587type NXActionController2PropReason struct {
15921588 * PropHeader /* Type: NXAC2PT_REASON */
15931589 Reason uint8
1594- pad [3 ]uint8
15951590}
15961591
15971592func (a * NXActionController2PropReason ) Len () uint16 {
@@ -1643,7 +1638,6 @@ func NewReason(reason uint8) *NXActionController2PropReason {
16431638type NXActionController2PropUserdata struct {
16441639 * PropHeader /* Type: NXAC2PT_USERDATA */
16451640 Userdata []byte
1646- pad []uint8
16471641}
16481642
16491643func (a * NXActionController2PropUserdata ) Len () uint16 {
@@ -1695,7 +1689,6 @@ func NewUserdata(userdata []byte) *NXActionController2PropUserdata {
16951689
16961690type NXActionController2PropPause struct {
16971691 * PropHeader /* Type: NXAC2PT_PAUSE */
1698- pad [4 ]uint8
16991692}
17001693
17011694func (a * NXActionController2PropPause ) Len () uint16 {
@@ -1818,7 +1811,6 @@ func DecodeController2Prop(data []byte) (Property, error) {
18181811// NXActionController2 is NX action to output packet to the Controller set with a specified ID.
18191812type NXActionController2 struct {
18201813 * NXActionHeader
1821- pad [6 ]uint8
18221814
18231815 props []Property
18241816}
@@ -1843,6 +1835,7 @@ func (a *NXActionController2) MarshalBinary() (data []byte, err error) {
18431835 }
18441836 copy (data [n :], b )
18451837 n += int (a .NXActionHeader .Len ())
1838+ // 6 bytes for padding
18461839 n += 6
18471840
18481841 for _ , prop := range a .props {
0 commit comments