Date: Sat, 9 Jan 2016 12:43:02 -0500 From: "Jonathan T. Looney" <jtl@freebsd.org> To: "Alexander V. Chernikov" <melifaro@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org> Subject: Re: svn commit: r293544 - in head/sys: net netinet ofed/drivers/infiniband/ulp/ipoib Message-ID: <D2B6B044.4F359%jlooney@juniper.net> In-Reply-To: <201601091634.u09GYbwn041665@repo.freebsd.org> References: <201601091634.u09GYbwn041665@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 1/9/16, 11:34 AM, "owner-src-committers@freebsd.org on behalf of Alexander V. Chernikov" <owner-src-committers@freebsd.org on behalf of melifaro@FreeBSD.org> wrote: >Modified: head/sys/net/route.h >========================================================================== >==== >--- head/sys/net/route.h Sat Jan 9 16:33:55 2016 (r293543) >+++ head/sys/net/route.h Sat Jan 9 16:34:37 2016 (r293544) >@@ -64,9 +64,13 @@ struct route { > > #define RT_CACHING_CONTEXT 0x1 /* XXX: not used anywhere */ > #define RT_NORTREF 0x2 /* doesn't hold reference on ro_rt */ >-#define RT_L2_ME (1 << RT_L2_ME_BIT) >-#define RT_MAY_LOOP (1 << RT_MAY_LOOP_BIT) >-#define RT_HAS_HEADER (1 << RT_HAS_HEADER_BIT) >+#define RT_L2_ME (1 << RT_L2_ME_BIT) /* 0x0004 */ >+#define RT_MAY_LOOP (1 << RT_MAY_LOOP_BIT) /* 0x0008 */ >+#define RT_HAS_HEADER (1 << RT_HAS_HEADER_BIT) /* 0x0010 */ >+ >+#define RT_REJECT 0x0020 /* Destination is reject */ >+#define RT_BLACKHOLE 0x0040 /* Destination is blackhole */ >+#define RT_HAS_GW 0x0080 /* Destination has GW */ > > struct rt_metrics { > u_long rmx_locks; /* Kernel must leave these values alone */ >@@ -215,6 +219,19 @@ fib_rte_to_nh_flags(int rt_flags) > return (res); > } > >+/* rte<>ro_flags translation */ >+static inline void >+rt_update_ro_flags(struct route *ro) >+{ >+ int rt_flags = ro->ro_rt->rt_flags; >+ >+ ro->ro_flags &= ~ (RT_REJECT|RT_BLACKHOLE|RT_HAS_GW); >+ >+ ro->ro_flags = (rt_flags & RTF_REJECT) ? RT_REJECT : 0; >+ ro->ro_flags |= (rt_flags & RTF_BLACKHOLE) ? RT_BLACKHOLE : 0; >+ ro->ro_flags |= (rt_flags & RTF_GATEWAY) ? RT_HAS_GW : 0; >+} >+ > /* > * Routing statistics. > */ rt_update_ro_flags() probably needs to be wrapped in the same #if check that encloses the struct rtentry definition: #if defined(_KERNEL) || defined(_WANT_RTENTRY) Jonathan
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D2B6B044.4F359%jlooney>