Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Apr 2018 21:24:17 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r332256 - stable/11/sys/netinet/libalias
Message-ID:  <201804072124.w37LOH6E019711@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Sat Apr  7 21:24:17 2018
New Revision: 332256
URL: https://svnweb.freebsd.org/changeset/base/332256

Log:
  MFC r327209:
  
  Clarify that there is no break missing. While there, cleanup whitespaces.

Modified:
  stable/11/sys/netinet/libalias/alias_sctp.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/libalias/alias_sctp.c
==============================================================================
--- stable/11/sys/netinet/libalias/alias_sctp.c	Sat Apr  7 21:22:29 2018	(r332255)
+++ stable/11/sys/netinet/libalias/alias_sctp.c	Sat Apr  7 21:24:17 2018	(r332256)
@@ -1735,27 +1735,28 @@ ProcessSctpMsg(struct libalias *la, int direction, str
 static int
 ID_process(struct libalias *la, int direction, struct sctp_nat_assoc *assoc, struct sctp_nat_msg *sm)
 {
-	switch(sm->msg) {
+	switch (sm->msg) {
 	case SN_SCTP_ASCONF:           /* a packet containing an ASCONF chunk with ADDIP */
 		if (!sysctl_accept_global_ootb_addip && (direction == SN_TO_LOCAL))
-			return(SN_DROP_PKT);
+			return (SN_DROP_PKT);
 		/* if this Asconf packet does not contain the Vtag parameters it is of no use in Idle state */
 		if (!GetAsconfVtags(la, sm, &(assoc->l_vtag), &(assoc->g_vtag), direction))
-			return(SN_DROP_PKT);
+			return (SN_DROP_PKT);
+		/* FALLTHROUGH */
 	case SN_SCTP_INIT:            /* a packet containing an INIT chunk or an ASCONF AddIP */
 		if (sysctl_track_global_addresses)
 			AddGlobalIPAddresses(sm, assoc, direction);
-		switch(direction){
+		switch (direction) {
 		case SN_TO_GLOBAL:
 			assoc->l_addr = sm->ip_hdr->ip_src;
 			assoc->a_addr = FindAliasAddress(la, assoc->l_addr);
 			assoc->l_port = sm->sctp_hdr->src_port;
 			assoc->g_port = sm->sctp_hdr->dest_port;
-			if(sm->msg == SN_SCTP_INIT)
+			if (sm->msg == SN_SCTP_INIT)
 				assoc->g_vtag = sm->sctpchnk.Init->initiate_tag;
 			if (AddSctpAssocGlobal(la, assoc)) /* DB clash *///**** need to add dst address
 				return((sm->msg == SN_SCTP_INIT) ? SN_REPLY_ABORT : SN_REPLY_ERROR);
-			if(sm->msg == SN_SCTP_ASCONF) {
+			if (sm->msg == SN_SCTP_ASCONF) {
 				if (AddSctpAssocLocal(la, assoc, sm->ip_hdr->ip_dst)) /* DB clash */
 					return(SN_REPLY_ERROR);
 				assoc->TableRegister |= SN_WAIT_TOLOCAL; /* wait for tolocal ack */
@@ -1766,25 +1767,25 @@ ID_process(struct libalias *la, int direction, struct 
 			assoc->a_addr = sm->ip_hdr->ip_dst; 
 			assoc->l_port = sm->sctp_hdr->dest_port;
 			assoc->g_port = sm->sctp_hdr->src_port;
-			if(sm->msg == SN_SCTP_INIT)
+			if (sm->msg == SN_SCTP_INIT)
 				assoc->l_vtag = sm->sctpchnk.Init->initiate_tag;
 			if (AddSctpAssocLocal(la, assoc, sm->ip_hdr->ip_src)) /* DB clash */
 				return((sm->msg == SN_SCTP_INIT) ? SN_REPLY_ABORT : SN_REPLY_ERROR);
-			if(sm->msg == SN_SCTP_ASCONF) {
+			if (sm->msg == SN_SCTP_ASCONF) {
 				if (AddSctpAssocGlobal(la, assoc)) /* DB clash */ //**** need to add src address
 					return(SN_REPLY_ERROR);
 				assoc->TableRegister |= SN_WAIT_TOGLOBAL; /* wait for toglobal ack */
 					}
 			break;
 		}
-	assoc->state = (sm->msg == SN_SCTP_INIT) ? SN_INi : SN_INa;
-	assoc->exp = SN_I_T(la);
-	sctp_AddTimeOut(la,assoc);
-	return(SN_NAT_PKT);
+		assoc->state = (sm->msg == SN_SCTP_INIT) ? SN_INi : SN_INa;
+		assoc->exp = SN_I_T(la);
+		sctp_AddTimeOut(la,assoc);
+		return (SN_NAT_PKT);
 	default: /* Any other type of SCTP message is not valid in Idle */
-		return(SN_DROP_PKT);
+		return (SN_DROP_PKT);
 	}
-return(SN_DROP_PKT);/* shouldn't get here very bad: log, drop and hope for the best */
+	return (SN_DROP_PKT);/* shouldn't get here very bad: log, drop and hope for the best */
 }
 
 /** @ingroup state_machine



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