Skip to content

Commit

Permalink
Forward error to user
Browse files Browse the repository at this point in the history
Signed-off-by: Lehner Florian <[email protected]>
  • Loading branch information
florianl committed May 23, 2019
1 parent edb32d2 commit bde7070
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
12 changes: 10 additions & 2 deletions attributeTcMsg.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,19 @@ func extractActStats(data []byte, stats *ActionStats) error {
}

func extractClsact(data []byte) error {
return fmt.Errorf("extractClsact()\t%v", data)
// Clsact is parameterless - so we expect to options
if len(data) != 0 {
return fmt.Errorf("extractClsact()\t%v", data)
}
return nil
}

func extractIngress(data []byte) error {
return fmt.Errorf("extractIngress()\t%v", data)
// Ingress is parameterless - so we expect to options
if len(data) != 0 {
return fmt.Errorf("extractIngress()\t%v", data)
}
return nil
}

const (
Expand Down
5 changes: 4 additions & 1 deletion tc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package tc

import (
"encoding/binary"
"fmt"
"unsafe"

"github.com/mdlayher/netlink"
Expand Down Expand Up @@ -95,7 +96,9 @@ func (tc *Tc) action(action int, flags netlink.HeaderFlags, info *Object, opts [
}

for _, msg := range msgs {
_ = msg
if msg.Header.Type == netlink.Error {
return fmt.Errorf("could not process query: %v", err)
}
}

return nil
Expand Down

0 comments on commit bde7070

Please sign in to comment.