svn commit: r193681 - user/kmacy/releng_7_2_fcs/sys/netinet
Kip Macy
kmacy at FreeBSD.org
Mon Jun 8 04:09:13 UTC 2009
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);
More information about the svn-src-user
mailing list