···283283#define SCTP_RTO_BETA 2 /* 1/4 when converted to right shifts. */284284285285/* Maximum number of new data packets that can be sent in a burst. */286286-#define SCTP_MAX_BURST 4286286+#define SCTP_DEFAULT_MAX_BURST 4287287288288#define SCTP_CLOCK_GRANULARITY 1 /* 1 jiffy */289289
+1
include/net/sctp/structs.h
···276276 __u32 default_context;277277 __u32 default_timetolive;278278 __u32 default_rcv_context;279279+ int max_burst;279280280281 /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to281282 * the destination address every heartbeat interval. This value
+2
include/net/sctp/user.h
···101101#define SCTP_FRAGMENT_INTERLEAVE SCTP_FRAGMENT_INTERLEAVE102102 SCTP_PARTIAL_DELIVERY_POINT, /* Set/Get partial delivery point */103103#define SCTP_PARTIAL_DELIVERY_POINT SCTP_PARTIAL_DELIVERY_POINT104104+ SCTP_MAX_BURST, /* Set/Get max burst */105105+#define SCTP_MAX_BURST SCTP_MAX_BURST104106105107 /* Internal Socket Options. Some of the sctp library functions are 106108 * implemented using these socket options.
+1-1
net/sctp/associola.c
···143143 /* Initialize the maximum mumber of new data packets that can be sent144144 * in a burst.145145 */146146- asoc->max_burst = sctp_max_burst;146146+ asoc->max_burst = sp->max_burst;147147148148 /* initialize association timers */149149 asoc->timeouts[SCTP_EVENT_TIMEOUT_NONE] = 0;
···28922892 return 0; /* is this the right error code? */28932893}2894289428952895+/*28962896+ * 7.1.28. Set or Get the maximum burst (SCTP_MAX_BURST)28972897+ *28982898+ * This option will allow a user to change the maximum burst of packets28992899+ * that can be emitted by this association. Note that the default value29002900+ * is 4, and some implementations may restrict this setting so that it29012901+ * can only be lowered.29022902+ *29032903+ * NOTE: This text doesn't seem right. Do this on a socket basis with29042904+ * future associations inheriting the socket value.29052905+ */29062906+static int sctp_setsockopt_maxburst(struct sock *sk,29072907+ char __user *optval,29082908+ int optlen)29092909+{29102910+ int val;29112911+29122912+ if (optlen != sizeof(int))29132913+ return -EINVAL;29142914+ if (get_user(val, (int __user *)optval))29152915+ return -EFAULT;29162916+29172917+ if (val < 0)29182918+ return -EINVAL;29192919+29202920+ sctp_sk(sk)->max_burst = val;29212921+29222922+ return 0;29232923+}29242924+28952925/* API 6.2 setsockopt(), getsockopt()28962926 *28972927 * Applications use setsockopt() and getsockopt() to set or retrieve···30413011 break;30423012 case SCTP_FRAGMENT_INTERLEAVE:30433013 retval = sctp_setsockopt_fragment_interleave(sk, optval, optlen);30143014+ break;30153015+ case SCTP_MAX_BURST:30163016+ retval = sctp_setsockopt_maxburst(sk, optval, optlen);30443017 break;30453018 default:30463019 retval = -ENOPROTOOPT;···32043171 sp->default_timetolive = 0;3205317232063173 sp->default_rcv_context = 0;31743174+ sp->max_burst = sctp_max_burst;3207317532083176 /* Initialize default setup parameters. These parameters32093177 * can be modified with the SCTP_INITMSG socket option or···47234689 return -ENOTSUPP;47244690}4725469146924692+/*46934693+ * 7.1.28. Set or Get the maximum burst (SCTP_MAX_BURST)46944694+ * (chapter and verse is quoted at sctp_setsockopt_maxburst())46954695+ */46964696+static int sctp_getsockopt_maxburst(struct sock *sk, int len,46974697+ char __user *optval,46984698+ int __user *optlen)46994699+{47004700+ int val;47014701+47024702+ if (len < sizeof(int))47034703+ return -EINVAL;47044704+47054705+ len = sizeof(int);47064706+47074707+ val = sctp_sk(sk)->max_burst;47084708+ if (put_user(len, optlen))47094709+ return -EFAULT;47104710+ if (copy_to_user(optval, &val, len))47114711+ return -EFAULT;47124712+47134713+ return -ENOTSUPP;47144714+}47154715+47264716SCTP_STATIC int sctp_getsockopt(struct sock *sk, int level, int optname,47274717 char __user *optval, int __user *optlen)47284718{···48664808 case SCTP_PARTIAL_DELIVERY_POINT:48674809 retval = sctp_getsockopt_partial_delivery_point(sk, len, optval,48684810 optlen);48114811+ break;48124812+ case SCTP_MAX_BURST:48134813+ retval = sctp_getsockopt_maxburst(sk, len, optval, optlen);48694814 break;48704815 default:48714816 retval = -ENOPROTOOPT;