Skip to content

Commit

Permalink
plugins/meta/sbr: Adjusted ipv6 address mask to /128
Browse files Browse the repository at this point in the history
A /64 mask was used which routed an entire cidr based on source,
not only the bound address.

Fixes #478

Signed-off-by: Lars Ekman <[email protected]>
  • Loading branch information
Lars Ekman committed Apr 28, 2020
1 parent 5af9ff4 commit 02bfece
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/meta/sbr/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func doRoutes(ipCfgs []*current.IPConfig, origRoutes []*types.Route, iface strin
if ipCfg.Version == "4" {
src.Mask = net.CIDRMask(32, 32)
} else {
src.Mask = net.CIDRMask(64, 64)
src.Mask = net.CIDRMask(128, 128)
}

log.Printf("Source to use %s", src.String())
Expand All @@ -258,7 +258,7 @@ func doRoutes(ipCfgs []*current.IPConfig, origRoutes []*types.Route, iface strin
dest.Mask = net.CIDRMask(0, 32)
} else {
dest.IP = net.IPv6zero
dest.Mask = net.CIDRMask(0, 64)
dest.Mask = net.CIDRMask(0, 128)
}

route := netlink.Route{
Expand Down

1 comment on commit 02bfece

@nysan
Copy link

@nysan nysan commented on 02bfece Apr 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly, above will fix my issue

Please sign in to comment.