mirror of
https://github.com/vishvananda/netlink.git
synced 2025-09-26 20:01:13 +08:00
vxlan: Fix parseVxlanData for source port range
binary.Read() != nil check means error case, so the vxlan.Port{Low,High} are never populated. Fix the check. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:

committed by
Alessandro Boch

parent
9f534ef909
commit
0af32151e7
@@ -2821,7 +2821,7 @@ func parseVxlanData(link Link, data []syscall.NetlinkRouteAttr) {
|
||||
case nl.IFLA_VXLAN_PORT_RANGE:
|
||||
buf := bytes.NewBuffer(datum.Value[0:4])
|
||||
var pr vxlanPortRange
|
||||
if binary.Read(buf, binary.BigEndian, &pr) != nil {
|
||||
if binary.Read(buf, binary.BigEndian, &pr) == nil {
|
||||
vxlan.PortLow = int(pr.Lo)
|
||||
vxlan.PortHigh = int(pr.Hi)
|
||||
}
|
||||
|
Reference in New Issue
Block a user