Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Jan 2009 05:42:53 +0000 (UTC)
From:      Kip Macy <kmacy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r187010 - user/kmacy/HEAD_fast_net/sys/net
Message-ID:  <200901100542.n0A5grKk081343@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kmacy
Date: Sat Jan 10 05:42:53 2009
New Revision: 187010
URL: http://svn.freebsd.org/changeset/base/187010

Log:
  fix flag setting in RTM_CHANGE

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 05:24:47 2009	(r187009)
+++ user/kmacy/HEAD_fast_net/sys/net/route.h	Sat Jan 10 05:42:53 2009	(r187010)
@@ -230,7 +230,6 @@ struct rt_msghdr {
 	int	rtm_seq;	/* for sender to identify action */
 	int	rtm_errno;	/* why failed */
 	int	rtm_fmask;	/* bitmask used in RTM_CHANGE message */
-#define	rtm_use	rtm_fmask	/* deprecated, use rtm_rmx->rmx_pksent */
 	u_long	rtm_inits;	/* which metrics we are initializing */
 	struct	rt_metrics rtm_rmx; /* metrics themselves */
 };

Modified: user/kmacy/HEAD_fast_net/sys/net/rtsock.c
==============================================================================
--- user/kmacy/HEAD_fast_net/sys/net/rtsock.c	Sat Jan 10 05:24:47 2009	(r187009)
+++ user/kmacy/HEAD_fast_net/sys/net/rtsock.c	Sat Jan 10 05:42:53 2009	(r187010)
@@ -655,7 +655,6 @@ route_output(struct mbuf *m, struct sock
 			}
 			(void)rt_msg2(rtm->rtm_type, &info, (caddr_t)rtm, NULL);
 			rtm->rtm_flags = rt->rt_flags;
-			rtm->rtm_use = 0;
 			rt_getmetrics(&rt->rt_rmx, &rtm->rtm_rmx);
 			rtm->rtm_addrs = info.rti_addrs;
 			break;
@@ -709,10 +708,8 @@ route_output(struct mbuf *m, struct sock
 				rt->rt_ifp = info.rti_ifp;
 			}
 			/* Allow some flags to be toggled on change. */
-			if (rtm->rtm_fmask & RTF_FMASK)
-				rt->rt_flags = (rt->rt_flags &
-				    ~rtm->rtm_fmask) |
-				    (rtm->rtm_flags & rtm->rtm_fmask);
+			rt->rt_flags = (rt->rt_flags & ~RTF_FMASK) |
+				    (rtm->rtm_flags & RTF_FMASK);
 			rt_setmetrics(rtm->rtm_inits, &rtm->rtm_rmx,
 					&rt->rt_rmx);
 			rtm->rtm_index = rt->rt_ifp->if_index;
@@ -1273,7 +1270,10 @@ sysctl_dumpentry(struct radix_node *rn, 
 		struct rt_msghdr *rtm = (struct rt_msghdr *)w->w_tmem;
 
 		rtm->rtm_flags = rt->rt_flags;
-		rtm->rtm_use = rt->rt_rmx.rmx_pksent;
+		/*
+		 * let's be honest about this being a retarded hack
+		 */
+		rtm->rtm_fmask = rt->rt_rmx.rmx_pksent;
 		rt_getmetrics(&rt->rt_rmx, &rtm->rtm_rmx);
 		rtm->rtm_index = rt->rt_ifp->if_index;
 		rtm->rtm_errno = rtm->rtm_pid = rtm->rtm_seq = 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901100542.n0A5grKk081343>