Skip to content

Commit

Permalink
New RouteAddEcmp() call to allow a prefix to be added when one
Browse files Browse the repository at this point in the history
already exists via a different interface.

Fixes vishvananda#620

Signed-off-by: Michael Cambria <mcambria@redhat.com>
  • Loading branch information
mccv1r0 authored and gkodali-zededa committed May 21, 2021
1 parent 885f885 commit a10f93d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions route_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,19 @@ func (h *Handle) RouteAppend(route *Route) error {
return h.routeHandle(route, req, nl.NewRtMsg())
}

=======
// RouteAddEcmp will add a route to the system.
func RouteAddEcmp(route *Route) error {
return pkgHandle.RouteAddEcmp(route)
}

// RouteAddEcmp will add a route to the system.
func (h *Handle) RouteAddEcmp(route *Route) error {
flags := unix.NLM_F_CREATE | unix.NLM_F_ACK
req := h.newNetlinkRequest(unix.RTM_NEWROUTE, flags)
return h.routeHandle(route, req, nl.NewRtMsg())
}

// RouteReplace will add a route to the system.
// Equivalent to: `ip route replace $route`
func RouteReplace(route *Route) error {
Expand Down

0 comments on commit a10f93d

Please sign in to comment.