svn commit: r187005 - user/kmacy/HEAD_fast_net/sys/net
Kip Macy
kmacy at FreeBSD.org
Fri Jan 9 20:49:55 PST 2009
Author: kmacy
Date: Sat Jan 10 04:49:55 2009
New Revision: 187005
URL: http://svn.freebsd.org/changeset/base/187005
Log:
fetch weight when getting metrics
Modified:
user/kmacy/HEAD_fast_net/sys/net/route.h
user/kmacy/HEAD_fast_net/sys/net/rtsock.c
Modified: user/kmacy/HEAD_fast_net/sys/net/route.h
==============================================================================
--- user/kmacy/HEAD_fast_net/sys/net/route.h Sat Jan 10 04:42:53 2009 (r187004)
+++ user/kmacy/HEAD_fast_net/sys/net/route.h Sat Jan 10 04:49:55 2009 (r187005)
@@ -204,7 +204,7 @@ struct ortentry {
/* Mask of RTF flags that are allowed to be modified by RTM_CHANGE. */
#define RTF_FMASK \
(RTF_PROTO1 | RTF_PROTO2 | RTF_PROTO3 | RTF_BLACKHOLE | \
- RTF_REJECT | RTF_STATIC)
+ RTF_REJECT | RTF_STATIC | RTF_SHUTDOWN | RTF_STICKY)
/*
* Routing statistics.
@@ -271,7 +271,7 @@ struct rt_msghdr {
#define RTV_SSTHRESH 0x20 /* init or lock _ssthresh */
#define RTV_RTT 0x40 /* init or lock _rtt */
#define RTV_RTTVAR 0x80 /* init or lock _rttvar */
-#define RTV_WEIGHT 0x100 /* init or lock _rttvar */
+#define RTV_WEIGHT 0x100 /* init or lock _weight */
/*
* Bitmask values for rtm_addrs.
Modified: user/kmacy/HEAD_fast_net/sys/net/rtsock.c
==============================================================================
--- user/kmacy/HEAD_fast_net/sys/net/rtsock.c Sat Jan 10 04:42:53 2009 (r187004)
+++ user/kmacy/HEAD_fast_net/sys/net/rtsock.c Sat Jan 10 04:49:55 2009 (r187005)
@@ -785,7 +785,8 @@ static void
rt_setmetrics(u_long which, const struct rt_metrics *in,
struct rt_metrics_lite *out)
{
-#define metric(f, e) if (which & (f)) out->e = in->e;
+#define metric(f, e) if (which & (f)) { printf("setting 0x%x", f); out->e = in->e; }
+
/*
* Only these are stored in the routing entry since introduction
* of tcp hostcache. The rest is ignored.
@@ -805,6 +806,7 @@ rt_getmetrics(const struct rt_metrics_li
#define metric(e) out->e = in->e;
bzero(out, sizeof(*out));
metric(rmx_mtu);
+ metric(rmx_weight);
/* Kernel -> userland timebase conversion. */
out->rmx_expire = in->rmx_expire ?
in->rmx_expire - time_uptime + time_second : 0;
More information about the svn-src-user
mailing list