On 1/9/16, 11:34 AM, "[email protected] on behalf of
Alexander V. Chernikov" <[email protected] on behalf of
[email protected]> 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


_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to