Skip to content

Commit

Permalink
fix(routing): ip family match function
Browse files Browse the repository at this point in the history
- ipv4-in-ipv6 should match ipv6
  • Loading branch information
qdm12 committed May 22, 2023
1 parent d2b8dbc commit eed62fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/routing/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ var (
)

func ipMatchesFamily(ip netip.Addr, family int) bool {
return (family == netlink.FAMILY_V6 && ip.Is6()) ||
(family == netlink.FAMILY_V4 && (ip.Is4() || ip.Is4In6()))
return (family == netlink.FAMILY_V4 && ip.Is4()) ||
(family == netlink.FAMILY_V6 && ip.Is6())
}

func (r *Routing) assignedIP(interfaceName string, family int) (ip netip.Addr, err error) {
Expand Down

0 comments on commit eed62fd

Please sign in to comment.