vxlan bug fix: check VtepDevIndex when setting IFLA_VXLAN_LINK

This commit is contained in:
Eugene Yakubovich 2014-10-19 11:36:05 -07:00
parent 50bae0e9af
commit dd2d5f17ae
1 changed files with 1 additions and 1 deletions

View File

@ -180,7 +180,7 @@ type vxlanPortRange struct {
func addVxlanAttrs(vxlan* Vxlan, linkInfo *nl.RtAttr) {
data := nl.NewRtAttrChild(linkInfo, nl.IFLA_INFO_DATA, nil)
nl.NewRtAttrChild(data, nl.IFLA_VXLAN_ID, nl.Uint32Attr(uint32(vxlan.VxlanId)))
if vxlan.ParentIndex != 0 {
if vxlan.VtepDevIndex != 0 {
nl.NewRtAttrChild(data, nl.IFLA_VXLAN_LINK, nl.Uint32Attr(uint32(vxlan.VtepDevIndex)))
}
if vxlan.SrcAddr != nil {