Skip to content

Commit

Permalink
Fix parseIpTun to handle empty flow based flag
Browse files Browse the repository at this point in the history
Fixes #509
  • Loading branch information
vishvananda authored and fcrisciani committed Jan 27, 2020
1 parent 8f32382 commit 261f000
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion link_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -2116,7 +2116,11 @@ func parseVxlanData(link Link, data []syscall.NetlinkRouteAttr) {
case nl.IFLA_VXLAN_GBP:
vxlan.GBP = true
case nl.IFLA_VXLAN_FLOWBASED:
vxlan.FlowBased = int8(datum.Value[0]) != 0
// NOTE(vish): Apparently this message can be sent with no value.
// Unclear if the others be sent that way as well.
if len(datum.Value) > 0 {
vxlan.FlowBased = int8(datum.Value[0]) != 0
}
case nl.IFLA_VXLAN_AGEING:
vxlan.Age = int(native.Uint32(datum.Value[0:4]))
vxlan.NoAge = vxlan.Age == 0
Expand Down

0 comments on commit 261f000

Please sign in to comment.