Author: tuexen
Date: Fri May 29 12:22:35 2015
New Revision: 283715
URL: https://svnweb.freebsd.org/changeset/base/283715

Log:
  MFC r277053:
  
  Remove dead code.
  
  Reported by:  Coverity
  CID:          748664

Modified:
  stable/10/sys/netinet/sctp_output.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netinet/sctp_output.c
==============================================================================
--- stable/10/sys/netinet/sctp_output.c Fri May 29 12:19:41 2015        
(r283714)
+++ stable/10/sys/netinet/sctp_output.c Fri May 29 12:22:35 2015        
(r283715)
@@ -8917,12 +8917,11 @@ sctp_send_cookie_echo(struct mbuf *m,
        struct sctp_tmit_chunk *chk;
        uint16_t ptype, plen;
 
+       SCTP_TCB_LOCK_ASSERT(stcb);
        /* First find the cookie in the param area */
        cookie = NULL;
        at = offset + sizeof(struct sctp_init_chunk);
-
-       SCTP_TCB_LOCK_ASSERT(stcb);
-       do {
+       for (;;) {
                phdr = sctp_get_next_param(m, at, &parm, sizeof(parm));
                if (phdr == NULL) {
                        return (-3);
@@ -8949,13 +8948,8 @@ sctp_send_cookie_echo(struct mbuf *m,
                        break;
                }
                at += SCTP_SIZE32(plen);
-       } while (phdr);
-       if (cookie == NULL) {
-               /* Did not find the cookie */
-               return (-3);
        }
        /* ok, we got the cookie lets change it into a cookie echo chunk */
-
        /* first the change from param to cookie */
        hdr = mtod(cookie, struct sctp_chunkhdr *);
        hdr->chunk_type = SCTP_COOKIE_ECHO;
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to