Skip to content

Commit

Permalink
Export LinkModify function
Browse files Browse the repository at this point in the history
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] vishvananda#541
  • Loading branch information
tobias-urdin authored and deepakkumarbhagat committed Jun 15, 2023
1 parent 55316b7 commit 50da14b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions link_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,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)
}
Expand Down
2 changes: 1 addition & 1 deletion link_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,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)
}

Expand Down

0 comments on commit 50da14b

Please sign in to comment.