Skip to content

Commit a17cdea

Browse files
committed
Change sizeof_header function to be less specific
1 parent 4f2f4a7 commit a17cdea

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/OpenFlow0x04.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,8 +1116,8 @@ module Oxm = struct
11161116
let sizeof (oxm : oxm) : int =
11171117
sizeof_ofp_oxm + field_length oxm
11181118

1119-
let sizeof_header (oxml : oxm list) : int =
1120-
(List.length oxml) * 4
1119+
let sizeof_header (oxml : oxm) : int =
1120+
sizeof_ofp_oxm
11211121

11221122
let to_string oxm =
11231123
match oxm with
@@ -4084,17 +4084,17 @@ module TableFeatureProp = struct
40844084
| TfpApplyActionMiss act ->
40854085
sum (map ActionHdr.sizeof act)
40864086
| TfpMatch ox ->
4087-
Oxm.sizeof_header ox
4087+
sum (map Oxm.sizeof_header ox)
40884088
| TfpWildcard ox ->
4089-
Oxm.sizeof_header ox
4089+
sum (map Oxm.sizeof_header ox)
40904090
| TfpWriteSetField ox->
4091-
Oxm.sizeof_header ox
4091+
sum (map Oxm.sizeof_header ox)
40924092
| TfpWriteSetFieldMiss ox ->
4093-
Oxm.sizeof_header ox
4093+
sum (map Oxm.sizeof_header ox)
40944094
| TfpApplySetField ox ->
4095-
Oxm.sizeof_header ox
4095+
sum (map Oxm.sizeof_header ox)
40964096
| TfpApplySetFieldMiss ox ->
4097-
Oxm.sizeof_header ox
4097+
sum (map Oxm.sizeof_header ox)
40984098
| TfpExperimenter (_,by) ->
40994099
Cstruct.len by
41004100
| TfpExperimenterMiss (_,by) ->

0 commit comments

Comments
 (0)