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 #620

Signed-off-by: Michael Cambria <[email protected]>
  • Loading branch information
mccv1r0 committed Mar 10, 2021
1 parent 3bf47fa commit c112076
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions route_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,18 @@ func (h *Handle) RouteAdd(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 c112076

Please sign in to comment.