Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jun 2015 16:01:42 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r284326 - head/sys/netinet
Message-ID:  <201506121601.t5CG1gqU074869@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Fri Jun 12 16:01:41 2015
New Revision: 284326
URL: https://svnweb.freebsd.org/changeset/base/284326

Log:
  In case of an output error, continue with the next net, don't try to
  continue sending on the same net.
  
  This fixes a bug where an invalid mbuf chain was constructed, if a
  full size frame of control chunks should be sent and there is a
  output error.
  
  Based on a discussion with rrs@, change move to the next net. This fixes
  the bug and improves the behaviour.
  
  Thanks to Irene Ruengeler for spending a lot of time in narrowing this
  problem down.
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==============================================================================
--- head/sys/netinet/sctp_output.c	Fri Jun 12 15:14:08 2015	(r284325)
+++ head/sys/netinet/sctp_output.c	Fri Jun 12 16:01:41 2015	(r284326)
@@ -7985,6 +7985,7 @@ again_one_more_time:
 		} else {
 			r_mtu = mtu;
 		}
+		error = 0;
 		/************************/
 		/* ASCONF transmission */
 		/************************/
@@ -8143,7 +8144,7 @@ again_one_more_time:
 							sctp_move_chunks_from_net(stcb, net);
 						}
 						*reason_code = 7;
-						continue;
+						break;
 					} else
 						asoc->ifp_had_enobuf = 0;
 					if (*now_filled == 0) {
@@ -8186,6 +8187,10 @@ again_one_more_time:
 				}
 			}
 		}
+		if (error != 0) {
+			/* try next net */
+			continue;
+		}
 		/************************/
 		/* Control transmission */
 		/************************/
@@ -8420,7 +8425,7 @@ again_one_more_time:
 							sctp_move_chunks_from_net(stcb, net);
 						}
 						*reason_code = 7;
-						continue;
+						break;
 					} else
 						asoc->ifp_had_enobuf = 0;
 					/* Only HB or ASCONF advances time */
@@ -8466,6 +8471,10 @@ again_one_more_time:
 				}
 			}
 		}
+		if (error != 0) {
+			/* try next net */
+			continue;
+		}
 		/* JRI: if dest is in PF state, do not send data to it */
 		if ((asoc->sctp_cmt_on_off > 0) &&
 		    (net != stcb->asoc.alternate) &&



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