From 615a6e4415c2c83ab7d5b32f1869b78493e1d3a7 Mon Sep 17 00:00:00 2001 From: niusmallnan Date: Wed, 27 Nov 2019 08:23:09 +0000 Subject: [PATCH] Update vishvananda/netlink to support set on /31 Interfaces --- trash.conf | 2 +- vendor/github.com/vishvananda/netlink/addr_linux.go | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/trash.conf b/trash.conf index 5a4acc88..23291abb 100644 --- a/trash.conf +++ b/trash.conf @@ -29,7 +29,7 @@ github.com/sigma/vmw-ovflib master github.com/sigma/bdoor master github.com/stretchr/testify a1f97990ddc16022ec7610326dd9bce31332c116 github.com/vbatts/tar-split v0.9.11 -github.com/vishvananda/netlink f5a6f697a596c788d474984a38a0ac4ba0719e93 +github.com/vishvananda/netlink b76f71f1d33745ac0833fff4277481599a8ee73f https://github.com/niusmallnan/netlink github.com/vishvananda/netns 54f0e4339ce73702a0607f49922aaa1e749b418d github.com/xeipuuv/gojsonpointer 6fe8760cad3569743d51ddbb243b26f8456742dc github.com/xeipuuv/gojsonreference e02fc20de94c78484cd5ffb007f8af96be030a45 diff --git a/vendor/github.com/vishvananda/netlink/addr_linux.go b/vendor/github.com/vishvananda/netlink/addr_linux.go index 92edb90d..67357be9 100644 --- a/vendor/github.com/vishvananda/netlink/addr_linux.go +++ b/vendor/github.com/vishvananda/netlink/addr_linux.go @@ -103,14 +103,17 @@ func (h *Handle) addrHandle(link Link, addr *Addr, req *nl.NetlinkRequest) error } } - if addr.Broadcast == nil { + if addr.Broadcast == nil && prefixlen < 31 { calcBroadcast := make(net.IP, masklen/8) for i := range localAddrData { calcBroadcast[i] = localAddrData[i] | ^addr.Mask[i] } addr.Broadcast = calcBroadcast } - req.AddData(nl.NewRtAttr(syscall.IFA_BROADCAST, addr.Broadcast)) + + if addr.Broadcast != nil { + req.AddData(nl.NewRtAttr(syscall.IFA_BROADCAST, addr.Broadcast)) + } if addr.Label != "" { labelData := nl.NewRtAttr(syscall.IFA_LABEL, nl.ZeroTerminated(addr.Label))