From owner-svn-src-user@FreeBSD.ORG Tue Oct 13 09:21:16 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 455351065670; Tue, 13 Oct 2009 09:21:16 +0000 (UTC) (envelope-from eri@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3379F8FC14; Tue, 13 Oct 2009 09:21:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9D9LGnu000288; Tue, 13 Oct 2009 09:21:16 GMT (envelope-from eri@svn.freebsd.org) Received: (from eri@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9D9LGMx000286; Tue, 13 Oct 2009 09:21:16 GMT (envelope-from eri@svn.freebsd.org) Message-Id: <200910130921.n9D9LGMx000286@svn.freebsd.org> From: Ermal Luçi Date: Tue, 13 Oct 2009 09:21:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198023 - user/eri/pf45/head/sys/contrib/pf/net X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2009 09:21:16 -0000 Author: eri Date: Tue Oct 13 09:21:15 2009 New Revision: 198023 URL: http://svn.freebsd.org/changeset/base/198023 Log: * Activate the support for radix multipath when compiled in the kernel. * Some more whitespace fixes. Modified: user/eri/pf45/head/sys/contrib/pf/net/pf.c Modified: user/eri/pf45/head/sys/contrib/pf/net/pf.c ============================================================================== --- user/eri/pf45/head/sys/contrib/pf/net/pf.c Tue Oct 13 07:00:17 2009 (r198022) +++ user/eri/pf45/head/sys/contrib/pf/net/pf.c Tue Oct 13 09:21:15 2009 (r198023) @@ -35,48 +35,46 @@ * */ - #ifdef __FreeBSD__ - #include "opt_inet.h" - #include "opt_inet6.h" - - #include +#ifdef __FreeBSD__ +#include "opt_inet.h" +#include "opt_inet6.h" + +#include __FBSDID("$FreeBSD$"); - #endif +#endif - #ifdef __FreeBSD__ - #include "opt_bpf.h" - #include "opt_pf.h" - - #ifdef DEV_BPF - #define NBPFILTER DEV_BPF - #else - #define NBPFILTER 0 - #endif - - #ifdef DEV_PFLOG - #define NPFLOG DEV_PFLOG - #else - #define NPFLOG 0 - #endif - - #ifdef DEV_PFSYNC - #define NPFSYNC DEV_PFSYNC - #else - #define NPFSYNC 0 - #endif - - #ifdef DEV_PFLOW - #define NPFLOW DEV_PFLOW - #else - #define NPFLOW 0 - #endif +#ifdef __FreeBSD__ +#include "opt_bpf.h" +#include "opt_pf.h" - #else +#ifdef DEV_BPF +#define NBPFILTER DEV_BPF +#else +#define NBPFILTER 0 +#endif + +#ifdef DEV_PFLOG +#define NPFLOG DEV_PFLOG +#else +#define NPFLOG 0 +#endif + +#ifdef DEV_PFSYNC +#define NPFSYNC DEV_PFSYNC +#else +#define NPFSYNC 0 +#endif + +#ifdef DEV_PFLOW +#define NPFLOW DEV_PFLOW +#else +#define NPFLOW 0 +#endif + +#else #include "bpfilter.h" #include "pflog.h" #include "pfsync.h" -#endif -#ifdef notyet #include "pflow.h" #endif @@ -5450,22 +5448,19 @@ pf_pull_hdr(struct mbuf *m, int off, voi int pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kif *kif) { - struct sockaddr_in *dst; - int ret = 1; - int check_mpath; #ifdef __FreeBSD__ #ifdef RADIX_MPATH - extern int ipmultipath; + struct radix_node_head *rnh; #endif -#else +#endif + struct sockaddr_in *dst; + int ret = 1; + int check_mpath; +#ifndef __FreeBSD__ extern int ipmultipath; #endif #ifdef INET6 -#ifdef __FreeBSD__ -#ifdef RADIX_MPATH - extern int ip6_multipath; -#endif -#else +#ifndef __FreeBSD__ extern int ip6_multipath; #endif struct sockaddr_in6 *dst6; @@ -5478,6 +5473,14 @@ pf_routable(struct pf_addr *addr, sa_fam struct ifnet *ifp; check_mpath = 0; +#ifdef __FreeBSD__ +#ifdef RADIX_MPATH + /* XXX: stick to table 0 for now */ + rnh = rt_tables_get_rnh(0, af); + if (rnh != NULL && rn_mpath_capable(rnh)) + check_mpath = 1; +#endif +#endif bzero(&ro, sizeof(ro)); switch (af) { case AF_INET: @@ -5485,7 +5488,7 @@ pf_routable(struct pf_addr *addr, sa_fam dst->sin_family = AF_INET; dst->sin_len = sizeof(*dst); dst->sin_addr = addr->v4; -#ifdef notyet +#ifndef __FreeBSD__ if (ipmultipath) check_mpath = 1; #endif @@ -5502,7 +5505,7 @@ pf_routable(struct pf_addr *addr, sa_fam dst6->sin6_family = AF_INET6; dst6->sin6_len = sizeof(*dst6); dst6->sin6_addr = addr->v6; -#ifdef notyet +#ifndef __FreeBSD__ if (ip6_multipath) check_mpath = 1; #endif @@ -5516,13 +5519,13 @@ pf_routable(struct pf_addr *addr, sa_fam if (kif != NULL && kif->pfik_ifp->if_type == IFT_ENC) goto out; - #ifdef __FreeBSD__ - /* XXX MRT not always INET */ /* stick with table 0 though */ +#ifdef __FreeBSD__ +/* XXX MRT not always INET */ /* stick with table 0 though */ if (af == AF_INET) in_rtalloc_ign((struct route *)&ro, 0, 0); else rtalloc_ign((struct route *)&ro, 0); - #else /* ! __FreeBSD__ */ +#else /* ! __FreeBSD__ */ rtalloc_noclone((struct route *)&ro, NO_CLONING); #endif @@ -5541,7 +5544,7 @@ pf_routable(struct pf_addr *addr, sa_fam rn = (struct radix_node *)ro.ro_rt; do { rt = (struct rtentry *)rn; - #ifndef __FreeBSD__ /* CARPDEV */ +#ifndef __FreeBSD__ /* CARPDEV */ if (rt->rt_ifp->if_type == IFT_CARP) ifp = rt->rt_ifp->if_carpdev; else