Skip to content

Commit

Permalink
fix: check for ext ACK TLVs
Browse files Browse the repository at this point in the history
checking for Extended ACK in nlmsghdr flags
should be done with bitwise AND op instead of OR op

Signed-off-by: adrianc <[email protected]>
  • Loading branch information
adrianchiris authored and aboch committed Nov 12, 2023
1 parent aa4f20d commit 95ab669
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nl/nl_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ done:
err = syscall.Errno(-errno)

unreadData := m.Data[4:]
if m.Header.Flags|unix.NLM_F_ACK_TLVS != 0 && len(unreadData) > syscall.SizeofNlMsghdr {
if m.Header.Flags&unix.NLM_F_ACK_TLVS != 0 && len(unreadData) > syscall.SizeofNlMsghdr {
// Skip the echoed request message.
echoReqH := (*syscall.NlMsghdr)(unsafe.Pointer(&unreadData[0]))
unreadData = unreadData[nlmAlignOf(int(echoReqH.Len)):]
Expand Down

0 comments on commit 95ab669

Please sign in to comment.