Index: sys/netinet/in_pcb.c =================================================================== --- sys/netinet/in_pcb.c +++ sys/netinet/in_pcb.c @@ -793,10 +793,10 @@ struct ifnet *ifp; ia = ifatoia(ifa_ifwithdstaddr((struct sockaddr *)sin, - RT_ALL_FIBS)); + inp->inp_socket->so_fibnum)); if (ia == NULL) ia = ifatoia(ifa_ifwithnet((struct sockaddr *)sin, 0, - RT_ALL_FIBS)); + inp->inp_socket->so_fibnum)); if (ia == NULL) { error = ENETUNREACH; goto done; @@ -911,10 +911,11 @@ sain.sin_len = sizeof(struct sockaddr_in); sain.sin_addr.s_addr = faddr->s_addr; - ia = ifatoia(ifa_ifwithdstaddr(sintosa(&sain), RT_ALL_FIBS)); + ia = ifatoia(ifa_ifwithdstaddr(sintosa(&sain), + inp->inp_socket->so_fibnum)); if (ia == NULL) ia = ifatoia(ifa_ifwithnet(sintosa(&sain), 0, - RT_ALL_FIBS)); + inp->inp_socket->so_fibnum)); if (ia == NULL) ia = ifatoia(ifa_ifwithaddr(sintosa(&sain))); Index: sys/netinet/ip_output.c =================================================================== --- sys/netinet/ip_output.c +++ sys/netinet/ip_output.c @@ -236,9 +236,9 @@ */ if (flags & IP_SENDONES) { if ((ia = ifatoia(ifa_ifwithbroadaddr(sintosa(dst), - RT_ALL_FIBS))) == NULL && + M_GETFIB(m)))) == NULL && (ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst), - RT_ALL_FIBS))) == NULL) { + M_GETFIB(m)))) == NULL) { IPSTAT_INC(ips_noroute); error = ENETUNREACH; goto bad; @@ -251,9 +251,9 @@ isbroadcast = 1; } else if (flags & IP_ROUTETOIF) { if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst), - RT_ALL_FIBS))) == NULL && + M_GETFIB(m)))) == NULL && (ia = ifatoia(ifa_ifwithnet(sintosa(dst), 0, - RT_ALL_FIBS))) == NULL) { + M_GETFIB(m)))) == NULL) { IPSTAT_INC(ips_noroute); error = ENETUNREACH; goto bad; Index: tests/sys/netinet/fibs_test.sh =================================================================== --- tests/sys/netinet/fibs_test.sh +++ tests/sys/netinet/fibs_test.sh @@ -366,7 +366,6 @@ udp_dontroute_body() { - atf_expect_fail "kern/187553 Source address selection for UDP packets with SO_DONTROUTE uses the default FIB" # Configure the TAP interface to use an RFC5737 nonrouteable address # and a non-default fib ADDR0="192.0.2.2"