Skip to content

Commit

Permalink
Support AF_BRIDGE familiy frames from ebtables
Browse files Browse the repository at this point in the history
checkHeader() should return 4 for AF_BRIDGE familiy frames as well.

Signed-off-by: Andy Huang <[email protected]>
  • Loading branch information
andytzuen authored and florianl committed Nov 6, 2023
1 parent ffe45bf commit ab638e3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func extractAttribute(a *Attribute, logger *log.Logger, data []byte) error {
}

func checkHeader(data []byte) int {
if (data[0] == unix.AF_INET || data[0] == unix.AF_INET6) && data[1] == unix.NFNETLINK_V0 {
if (data[0] == unix.AF_INET || data[0] == unix.AF_INET6 || data[0] == unix.AF_BRIDGE) && data[1] == unix.NFNETLINK_V0 {
return 4
}
return 0
Expand Down
1 change: 1 addition & 0 deletions internal/unix/types_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ const (
AF_UNSPEC = linux.AF_UNSPEC
AF_INET = linux.AF_INET
AF_INET6 = linux.AF_INET6
AF_BRIDGE = linux.AF_BRIDGE
)
1 change: 1 addition & 0 deletions internal/unix/types_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ const (
AF_UNSPEC = 0x0
AF_INET = 0x2
AF_INET6 = 0xa
AF_BRIDGE = 0x7
)

0 comments on commit ab638e3

Please sign in to comment.