Export LinkModify function

When the LinkModify was merged in [1] a function
that exports it outside of pkgHandle was never
added like is available for LinkAdd, LinkDel etc.

Update testing to use exported LinkModify that
itself calls the pkgHandle.LinkModify function.

[1] https://github.com/vishvananda/netlink/pull/541
This commit is contained in:
Tobias Urdin 2021-09-30 14:47:45 +02:00 committed by Alessandro Boch
parent b10eb8fe5c
commit 650dca95af
2 changed files with 5 additions and 1 deletions

View File

@ -1146,6 +1146,10 @@ func (h *Handle) LinkAdd(link Link) error {
return h.linkModify(link, unix.NLM_F_CREATE|unix.NLM_F_EXCL|unix.NLM_F_ACK)
}
func LinkModify(link Link) error {
return pkgHandle.LinkModify(link)
}
func (h *Handle) LinkModify(link Link) error {
return h.linkModify(link, unix.NLM_F_REQUEST|unix.NLM_F_ACK)
}

View File

@ -615,7 +615,7 @@ func TestLinkModify(t *testing.T) {
}
link.MTU = updatedMTU
if err := pkgHandle.LinkModify(link); err != nil {
if err := LinkModify(link); err != nil {
t.Fatal(err)
}