diff --git a/src/isboot.c b/src/isboot.c index d3ed644..6e8e2fe 100644 --- a/src/isboot.c +++ b/src/isboot.c @@ -48,6 +48,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#if __FreeBSD_version >= 1300102 +#include +#endif #include "ibft.h" #include "isboot.h" @@ -341,6 +344,31 @@ isboot_set_v6addr(struct ifnet *ifp, struct sockaddr_in6 *addr, int prefix) #if __FreeBSD_version < 701000 #define rtrequest_fib(r,d,g,m,f,e,n) rtrequest(r,d,g,m,f,e) +#elif __FreeBSD_version >= 1300102 + +static int +rtrequest_fib(int req, + struct sockaddr *dst, + struct sockaddr *gateway, + struct sockaddr *netmask, + int flags, + struct rtentry **ret_nrt, + u_int fibnum) +{ + struct rt_addrinfo info; + struct rib_cmd_info rc; + + if (dst->sa_len == 0) + return(EINVAL); + + bzero((caddr_t)&info, sizeof(info)); + info.rti_flags = flags; + info.rti_info[RTAX_DST] = dst; + info.rti_info[RTAX_GATEWAY] = gateway; + info.rti_info[RTAX_NETMASK] = netmask; + + return rib_action(fibnum, req, &info, &rc); +} #endif static int