From eed62fdc6dfd74d1dc0aa3103775e6963d3b2139 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Mon, 22 May 2023 06:01:52 +0000 Subject: [PATCH] fix(routing): ip family match function - ipv4-in-ipv6 should match ipv6 --- internal/routing/ip.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/routing/ip.go b/internal/routing/ip.go index 52232c5c..1d8c36b5 100644 --- a/internal/routing/ip.go +++ b/internal/routing/ip.go @@ -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) {