From 975cfa5f3255ae0ece3cdeda33675076b17be1c7 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 21 Aug 2024 14:20:11 +1000 Subject: Initialise our_tap_ll to ip6.gw when suitable In every place we use our_tap_ll, we only use it as a fallback if the IPv6 gateway address is not link-local. We can avoid that conditional at use time by doing it at initialisation of our_tap_ll instead. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- dhcpv6.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'dhcpv6.c') diff --git a/dhcpv6.c b/dhcpv6.c index fa1dccc..14a5c7e 100644 --- a/dhcpv6.c +++ b/dhcpv6.c @@ -453,10 +453,7 @@ int dhcpv6(struct ctx *c, const struct pool *p, c->ip6.addr_ll_seen = *saddr; - if (IN6_IS_ADDR_LINKLOCAL(&c->ip6.gw)) - src = &c->ip6.gw; - else - src = &c->ip6.our_tap_ll; + src = &c->ip6.our_tap_ll; mh = packet_get(p, 0, sizeof(*uh), sizeof(*mh), NULL); if (!mh) -- cgit v1.2.3