Re: svn commit: r327209 - head/sys/netinet/libalias

2017-12-26 Thread Michael Tuexen
> On 26. Dec 2017, at 17:14, Alexey Dokuchaev  wrote:
> 
> On Tue, Dec 26, 2017 at 04:12:04PM +, Michael Tuexen wrote:
>> New Revision: 327209
>> URL: https://svnweb.freebsd.org/changeset/base/327209
>> 
>> Log:
>>  Clearify CID 1008197.
> 
> Again, this "clarifies" nothing.  I see a bunch of style(9) bugs fixed,
> and fail to see how/why those had upset Coverity.
I added a
/* FALLTHROUGH */

Coverity was complaining that a break was possibly missing. Should not
have also fixed some style(9) issues and indentation issues in the same
function.

Best regards
Michael 
> 
> ./danfe

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r327209 - head/sys/netinet/libalias

2017-12-26 Thread Rodney W. Grimes
> Author: tuexen
> Date: Tue Dec 26 16:12:04 2017
> New Revision: 327209
> URL: https://svnweb.freebsd.org/changeset/base/327209
> 
> Log:
>   Clearify CID 1008197.
>   
>   MFC after:  3 days

This and the prior few commits log entries leave a great
deal to be desired from the perspective of someone reading
this.

> Modified:
>   head/sys/netinet/libalias/alias_sctp.c
> 
> Modified: head/sys/netinet/libalias/alias_sctp.c
> ==
> --- head/sys/netinet/libalias/alias_sctp.cTue Dec 26 16:06:11 2017
> (r327208)
> +++ head/sys/netinet/libalias/alias_sctp.cTue Dec 26 16:12:04 2017
> (r327209)
> @@ -1737,27 +1737,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 */
> @@ -1768,25 +1769,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
> 
> 

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-head@freebsd.org 

Re: svn commit: r327209 - head/sys/netinet/libalias

2017-12-26 Thread Alexey Dokuchaev
On Tue, Dec 26, 2017 at 04:12:04PM +, Michael Tuexen wrote:
> New Revision: 327209
> URL: https://svnweb.freebsd.org/changeset/base/327209
> 
> Log:
>   Clearify CID 1008197.

Again, this "clarifies" nothing.  I see a bunch of style(9) bugs fixed,
and fail to see how/why those had upset Coverity.

./danfe
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"