Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Jun 2009 04:09:13 +0000 (UTC)
From:      Kip Macy <kmacy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r193681 - user/kmacy/releng_7_2_fcs/sys/netinet
Message-ID:  <200906080409.n5849DgS015311@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kmacy
Date: Mon Jun  8 04:09:13 2009
New Revision: 193681
URL: http://svn.freebsd.org/changeset/base/193681

Log:
  give all udp packets a flowid

Modified:
  user/kmacy/releng_7_2_fcs/sys/netinet/in_pcb.c
  user/kmacy/releng_7_2_fcs/sys/netinet/udp_usrreq.c

Modified: user/kmacy/releng_7_2_fcs/sys/netinet/in_pcb.c
==============================================================================
--- user/kmacy/releng_7_2_fcs/sys/netinet/in_pcb.c	Mon Jun  8 04:08:18 2009	(r193680)
+++ user/kmacy/releng_7_2_fcs/sys/netinet/in_pcb.c	Mon Jun  8 04:09:13 2009	(r193681)
@@ -196,7 +196,8 @@ in_pcballoc(struct socket *so, struct in
 #endif
 	struct inpcb *inp;
 	int error;
-
+	static int flowid = 1;
+	
 	INP_INFO_WLOCK_ASSERT(pcbinfo);
 	error = 0;
 	inp = uma_zalloc(pcbinfo->ipi_zone, M_NOWAIT);
@@ -207,6 +208,7 @@ in_pcballoc(struct socket *so, struct in
 	inp->inp_socket = so;
 	inp->inp_cred = crhold(so->so_cred);
 	inp->inp_inc.inc_fibnum = so->so_fibnum;
+	inp->inp_flowid = flowid++;
 #ifdef MAC
 	error = mac_inpcb_init(inp, M_NOWAIT);
 	if (error != 0)

Modified: user/kmacy/releng_7_2_fcs/sys/netinet/udp_usrreq.c
==============================================================================
--- user/kmacy/releng_7_2_fcs/sys/netinet/udp_usrreq.c	Mon Jun  8 04:08:18 2009	(r193680)
+++ user/kmacy/releng_7_2_fcs/sys/netinet/udp_usrreq.c	Mon Jun  8 04:09:13 2009	(r193681)
@@ -1116,7 +1116,11 @@ udp_output(struct inpcb *inp, struct mbu
 		INP_INFO_WUNLOCK(&V_udbinfo);
 	else if (unlock_udbinfo == 1)
 		INP_INFO_RUNLOCK(&V_udbinfo);
-	error = ip_output(m, inp->inp_options, NULL, ipflags,
+	if (inp->inp_flowid != 0) {
+		m->m_pkthdr.flowid = inp->inp_flowid;
+		m->m_flags |= M_FLOWID;
+	}
+ 	error = ip_output(m, inp->inp_options, NULL, ipflags,
 	    inp->inp_moptions, inp);
 	if (unlock_udbinfo == 2)
 		INP_WUNLOCK(inp);



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