Author: tuexen
Date: Wed Jan 26 19:55:54 2011
New Revision: 217895
URL: http://svn.freebsd.org/changeset/base/217895

Log:
  Make SCTP_MAX_BURST compliant with the latest version of
  the socket API ID. This is not compatible with the API
  in stable/8.

Modified:
  head/sys/netinet/sctp_usrreq.c

Modified: head/sys/netinet/sctp_usrreq.c
==============================================================================
--- head/sys/netinet/sctp_usrreq.c      Wed Jan 26 19:49:03 2011        
(r217894)
+++ head/sys/netinet/sctp_usrreq.c      Wed Jan 26 19:55:54 2011        
(r217895)
@@ -1967,18 +1967,21 @@ flags_out:
                break;
        case SCTP_MAX_BURST:
                {
-                       uint8_t *value;
+                       struct sctp_assoc_value *av;
 
-                       SCTP_CHECK_AND_CAST(value, optval, uint8_t, *optsize);
+                       SCTP_CHECK_AND_CAST(av, optval, struct 
sctp_assoc_value, *optsize);
+                       SCTP_FIND_STCB(inp, stcb, av->assoc_id);
 
-                       SCTP_INP_RLOCK(inp);
-                       if (inp->sctp_ep.max_burst < 256) {
-                               *value = inp->sctp_ep.max_burst;
+                       if (stcb) {
+                               av->assoc_value = stcb->asoc.max_burst;
+                               SCTP_TCB_UNLOCK(stcb);
                        } else {
-                               *value = 255;
+                               SCTP_INP_RLOCK(inp);
+                               av->assoc_value = inp->sctp_ep.max_burst;
+                               SCTP_INP_RUNLOCK(inp);
                        }
-                       SCTP_INP_RUNLOCK(inp);
-                       *optsize = sizeof(uint8_t);
+                       *optsize = sizeof(struct sctp_assoc_value);
+
                }
                break;
        case SCTP_MAXSEG:
@@ -3590,13 +3593,19 @@ sctp_setopt(struct socket *so, int optna
                break;
        case SCTP_MAX_BURST:
                {
-                       uint8_t *burst;
+                       struct sctp_assoc_value *av;
 
-                       SCTP_CHECK_AND_CAST(burst, optval, uint8_t, optsize);
+                       SCTP_CHECK_AND_CAST(av, optval, struct 
sctp_assoc_value, optsize);
+                       SCTP_FIND_STCB(inp, stcb, av->assoc_id);
 
-                       SCTP_INP_WLOCK(inp);
-                       inp->sctp_ep.max_burst = *burst;
-                       SCTP_INP_WUNLOCK(inp);
+                       if (stcb) {
+                               stcb->asoc.max_burst = av->assoc_value;
+                               SCTP_TCB_UNLOCK(stcb);
+                       } else {
+                               SCTP_INP_WLOCK(inp);
+                               inp->sctp_ep.max_burst = av->assoc_value;
+                               SCTP_INP_WUNLOCK(inp);
+                       }
                }
                break;
        case SCTP_MAXSEG:
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to