From efeb8003117073d29bf82c8a69e036b8dbd78352 Mon Sep 17 00:00:00 2001 From: "Alexander V. Chernikov" Date: Fri, 24 Feb 2023 10:19:12 +0000 Subject: [PATCH] netlink: fix NOINET6 build. Reported by: Michael Paepcke PR: 269787 MFC after: 3 days --- sys/net/route/nhop_ctl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/net/route/nhop_ctl.c b/sys/net/route/nhop_ctl.c index 73c34f675a04..d99b78351952 100644 --- a/sys/net/route/nhop_ctl.c +++ b/sys/net/route/nhop_ctl.c @@ -836,16 +836,20 @@ nhop_set_blackhole(struct nhop_object *nh, int blackhole_rt_flag) bzero(&nh->gw_sa, sizeof(nh->gw_sa)); switch (nh->nh_priv->nh_upper_family) { +#ifdef INET case AF_INET: nh->gw4_sa.sin_family = AF_INET; nh->gw4_sa.sin_len = sizeof(struct sockaddr_in); nh->gw4_sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK); break; +#endif +#ifdef INET6 case AF_INET6: nh->gw6_sa.sin6_family = AF_INET6; nh->gw6_sa.sin6_len = sizeof(struct sockaddr_in6); nh->gw6_sa.sin6_addr = in6addr_loopback; break; +#endif } }