Skip to content

Commit

Permalink
Don't make setsockopt call if option is false
Browse files Browse the repository at this point in the history
  • Loading branch information
hmahmood authored and vishvananda committed Apr 4, 2022
1 parent 5cb84e4 commit 5e915e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nl/nl_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,10 @@ func (req *NetlinkRequest) Execute(sockType int, resType uint16) ([][]byte, erro
if err := s.SetReceiveTimeout(&SocketTimeoutTv); err != nil {
return nil, err
}
if err := s.SetExtAck(EnableErrorMessageReporting); err != nil {
return nil, err
if EnableErrorMessageReporting {
if err := s.SetExtAck(true); err != nil {
return nil, err
}
}

defer s.Close()
Expand Down

0 comments on commit 5e915e0

Please sign in to comment.