Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Apr 2016 07:34:41 +0000
From:      "sepherosa_gmail.com (Sepherosa Ziehau)" <phabric-noreply@FreeBSD.org>
To:        freebsd-net@freebsd.org
Subject:   [Differential] D6148: tcp/syncache: Add comment for syncache_respond
Message-ID:  <differential-rev-PHID-DREV-ergrrw76eskhond4myab-req@FreeBSD.org>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
sepherosa_gmail.com created this revision.
sepherosa_gmail.com added reviewers: network, adrian, rwatson, gnn, lstewart, glebius, delphij, mike-karels.net, jtl, hiren, sbruno, hselasky.
sepherosa_gmail.com added a subscriber: freebsd-net-list.
Herald added a reviewer: transport.

REVISION SUMMARY
  Suggested by: hiren, hps

REVISION DETAIL
  https://reviews.freebsd.org/D6148

AFFECTED FILES
  sys/netinet/tcp_syncache.c

CHANGE DETAILS
  diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
  --- a/sys/netinet/tcp_syncache.c
  +++ b/sys/netinet/tcp_syncache.c
  @@ -1505,6 +1505,10 @@
   	return (rv);
   }
   
  +/*
  + * Send SYN|ACK to the peer.  Either in response to the peer's SYN,
  + * i.e. m0 != NULL, or upon 3WHS ACK timeout, i.e. m0 == NULL.
  + */
   static int
   syncache_respond(struct syncache *sc, struct syncache_head *sch, int locked,
       const struct mbuf *m0)
  @@ -1688,6 +1692,11 @@
   
   	M_SETFIB(m, sc->sc_inc.inc_fibnum);
   	m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum);
  +	/*
  +	 * If we have peer's SYN and it has a flowid, then let's assign it to
  +	 * our SYN|ACK.  ip6_output() and ip_output() will not assign flowid
  +	 * to SYN|ACK due to lack of inp here.
  +	 */
   	if (m0 != NULL && M_HASHTYPE_GET(m0) != M_HASHTYPE_NONE) {
   		m->m_pkthdr.flowid = m0->m_pkthdr.flowid;
   		M_HASHTYPE_SET(m, M_HASHTYPE_GET(m0));

EMAIL PREFERENCES
  https://reviews.freebsd.org/settings/panel/emailpreferences/

To: sepherosa_gmail.com, network, transport, adrian, rwatson, gnn, lstewart, glebius, delphij, mike-karels.net, jtl, hiren, sbruno, hselasky
Cc: freebsd-net-list

[-- Attachment #2 --]
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -1505,6 +1505,10 @@
 	return (rv);
 }
 
+/*
+ * Send SYN|ACK to the peer.  Either in response to the peer's SYN,
+ * i.e. m0 != NULL, or upon 3WHS ACK timeout, i.e. m0 == NULL.
+ */
 static int
 syncache_respond(struct syncache *sc, struct syncache_head *sch, int locked,
     const struct mbuf *m0)
@@ -1688,6 +1692,11 @@
 
 	M_SETFIB(m, sc->sc_inc.inc_fibnum);
 	m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum);
+	/*
+	 * If we have peer's SYN and it has a flowid, then let's assign it to
+	 * our SYN|ACK.  ip6_output() and ip_output() will not assign flowid
+	 * to SYN|ACK due to lack of inp here.
+	 */
 	if (m0 != NULL && M_HASHTYPE_GET(m0) != M_HASHTYPE_NONE) {
 		m->m_pkthdr.flowid = m0->m_pkthdr.flowid;
 		M_HASHTYPE_SET(m, M_HASHTYPE_GET(m0));


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?differential-rev-PHID-DREV-ergrrw76eskhond4myab-req>