svn commit: r293544 - in head/sys: net netinet ofed/drivers/infiniband/ulp/ipoib
Jonathan T. Looney
jtl at freebsd.org
Sat Jan 9 18:03:52 UTC 2016
On 1/9/16, 11:34 AM, "owner-src-committers at freebsd.org on behalf of
Alexander V. Chernikov" <owner-src-committers at freebsd.org on behalf of
melifaro at 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
More information about the svn-src-all
mailing list