Skip to content

Commit 2426b05

Browse files
lwintermelonaboch
authored andcommitted
qdisc: fix wrong type info of tc_sfq_qopt
1 parent a2e4b9a commit 2426b05

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

nl/tc_linux.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,11 +1138,11 @@ const TCA_CLS_FLAGS_SKIP_SW = 1 << 1 /* don't use filter in SW */
11381138
// };
11391139

11401140
type TcSfqQopt struct {
1141-
Quantum uint8
1141+
Quantum uint32
11421142
Perturb int32
11431143
Limit uint32
1144-
Divisor uint8
1145-
Flows uint8
1144+
Divisor uint32
1145+
Flows uint32
11461146
}
11471147

11481148
func (x *TcSfqQopt) Len() int {

qdisc.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,10 @@ func (qdisc *FqCodel) Type() string {
374374
type Sfq struct {
375375
QdiscAttrs
376376
// TODO: Only the simplified options for SFQ are handled here. Support for the extended one can be added later.
377-
Quantum uint8
378-
Perturb uint8
377+
Quantum uint32
378+
Perturb int32
379379
Limit uint32
380-
Divisor uint8
380+
Divisor uint32
381381
}
382382

383383
func (sfq *Sfq) String() string {

qdisc_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ func qdiscPayload(req *nl.NetlinkRequest, qdisc Qdisc) error {
321321
case *Sfq:
322322
opt := nl.TcSfqQoptV1{}
323323
opt.TcSfqQopt.Quantum = qdisc.Quantum
324-
opt.TcSfqQopt.Perturb = int32(qdisc.Perturb)
324+
opt.TcSfqQopt.Perturb = qdisc.Perturb
325325
opt.TcSfqQopt.Limit = qdisc.Limit
326326
opt.TcSfqQopt.Divisor = qdisc.Divisor
327327

@@ -683,7 +683,7 @@ func parseSfqData(qdisc Qdisc, value []byte) error {
683683
sfq := qdisc.(*Sfq)
684684
opt := nl.DeserializeTcSfqQoptV1(value)
685685
sfq.Quantum = opt.TcSfqQopt.Quantum
686-
sfq.Perturb = uint8(opt.TcSfqQopt.Perturb)
686+
sfq.Perturb = opt.TcSfqQopt.Perturb
687687
sfq.Limit = opt.TcSfqQopt.Limit
688688
sfq.Divisor = opt.TcSfqQopt.Divisor
689689

0 commit comments

Comments
 (0)