Fix FLOWTABLE IPv6 handling in route.c missed in r205066.

While doing so, for consistency with the rtalloc_ign_fib(9) interface
called, remove the "in_" prefix from rtalloc_ign_wrapper() no longer
indicating that it would only handle the INET case.

Sponsored by:	Cisco Systems, Inc.
This commit is contained in:
Bjoern A. Zeeb 2012-02-03 10:17:34 +00:00
parent db566a23b6
commit 096f27864f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/multi-fibv6/head/; revision=230937
2 changed files with 24 additions and 11 deletions

View File

@ -374,7 +374,7 @@ SYSCTL_VNET_PROC(_net_inet_flowtable, OID_AUTO, stats, CTLTYPE_STRING|CTLFLAG_RD
#ifndef RADIX_MPATH
static void
in_rtalloc_ign_wrapper(struct route *ro, uint32_t hash, u_int fibnum)
rtalloc_ign_wrapper(struct route *ro, uint32_t hash, u_int fibnum)
{
rtalloc_ign_fib(ro, 0, fibnum);
@ -1315,7 +1315,7 @@ flowtable_alloc(char *name, int nentry, int flags)
#ifdef RADIX_MPATH
ft->ft_rtalloc = rtalloc_mpath_fib;
#else
ft->ft_rtalloc = in_rtalloc_ign_wrapper;
ft->ft_rtalloc = rtalloc_ign_wrapper;
#endif
if (flags & FL_PCPU) {
ft->ft_lock = flowtable_pcpu_lock;

View File

@ -35,6 +35,7 @@
***********************************************************************/
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_route.h"
#include "opt_mrouting.h"
#include "opt_mpath.h"
@ -1192,12 +1193,15 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt,
#ifdef FLOWTABLE
rt0 = NULL;
/* XXX
* "flow-table" only support IPv4 at the moment.
* XXX-BZ as of r205066 it would support IPv6.
*/
/* "flow-table" only supports IPv6 and IPv4 at the moment. */
switch (dst->sa_family) {
#ifdef INET6
case AF_INET6:
#endif
#ifdef INET
if (dst->sa_family == AF_INET) {
case AF_INET:
#endif
#if defined(INET6) || defined(INET)
rn = rnh->rnh_matchaddr(dst, rnh);
if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) {
struct sockaddr *mask;
@ -1236,9 +1240,9 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt,
}
}
}
#endif/* INET6 || INET */
}
#endif
#endif
#endif /* FLOWTABLE */
/* XXX mtu manipulation will be done in rnh_addaddr -- itojun */
rn = rnh->rnh_addaddr(ndst, netmask, rnh, rt->rt_nodes);
@ -1259,9 +1263,18 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt,
}
#ifdef FLOWTABLE
else if (rt0 != NULL) {
#ifdef INET
flowtable_route_flush(V_ip_ft, rt0);
switch (dst->sa_family) {
#ifdef INET6
case AF_INET6:
flowtable_route_flush(V_ip6_ft, rt0);
break;
#endif
#ifdef INET
case AF_INET:
flowtable_route_flush(V_ip_ft, rt0);
break;
#endif
}
RTFREE(rt0);
}
#endif