netlink: fix NOINET6 build.

Reported by:	Michael Paepcke <bugs.fbsd@paepcke.de>
PR:		269787
MFC after:	3 days
This commit is contained in:
Alexander V. Chernikov 2023-02-24 10:19:12 +00:00
parent 9d7cc536e2
commit efeb800311

View File

@ -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
}
}