fix: check for ext ACK TLVs

checking for Extended ACK in nlmsghdr flags
should be done with bitwise AND op instead of OR op

Signed-off-by: adrianc <adrianc@nvidia.com>
This commit is contained in:
adrianc 2023-11-12 13:26:15 +02:00 committed by Alessandro Boch
parent aa4f20db57
commit 95ab6696a5

View File

@ -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)):]