From owner-svn-src-projects@FreeBSD.ORG Fri Feb 3 10:17:35 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64D3B1065676; Fri, 3 Feb 2012 10:17:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49B618FC0A; Fri, 3 Feb 2012 10:17:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q13AHZ8L081188; Fri, 3 Feb 2012 10:17:35 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q13AHZws081185; Fri, 3 Feb 2012 10:17:35 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202031017.q13AHZws081185@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 3 Feb 2012 10:17:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230937 - projects/multi-fibv6/head/sys/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2012 10:17:35 -0000 Author: bz Date: Fri Feb 3 10:17:34 2012 New Revision: 230937 URL: http://svn.freebsd.org/changeset/base/230937 Log: 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. Modified: projects/multi-fibv6/head/sys/net/flowtable.c projects/multi-fibv6/head/sys/net/route.c Modified: projects/multi-fibv6/head/sys/net/flowtable.c ============================================================================== --- projects/multi-fibv6/head/sys/net/flowtable.c Fri Feb 3 09:33:58 2012 (r230936) +++ projects/multi-fibv6/head/sys/net/flowtable.c Fri Feb 3 10:17:34 2012 (r230937) @@ -374,7 +374,7 @@ SYSCTL_VNET_PROC(_net_inet_flowtable, OI #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, #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; Modified: projects/multi-fibv6/head/sys/net/route.c ============================================================================== --- projects/multi-fibv6/head/sys/net/route.c Fri Feb 3 09:33:58 2012 (r230936) +++ projects/multi-fibv6/head/sys/net/route.c Fri Feb 3 10:17:34 2012 (r230937) @@ -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_addrin #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_addrin } } } +#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_addrin } #ifdef FLOWTABLE else if (rt0 != NULL) { + switch (dst->sa_family) { +#ifdef INET6 + case AF_INET6: + flowtable_route_flush(V_ip6_ft, rt0); + break; +#endif #ifdef INET - flowtable_route_flush(V_ip_ft, rt0); + case AF_INET: + flowtable_route_flush(V_ip_ft, rt0); + break; #endif + } RTFREE(rt0); } #endif