@@ -162,7 +162,7 @@ int sctp_stream_init(struct sctp_stream *stream, __u16 outcnt, __u16 incnt,
162162
163163 stream -> outcnt = outcnt ;
164164 for (i = 0 ; i < stream -> outcnt ; i ++ )
165- stream -> out [ i ]. state = SCTP_STREAM_OPEN ;
165+ SCTP_SO ( stream , i ) -> state = SCTP_STREAM_OPEN ;
166166
167167 sched -> init (stream );
168168
@@ -193,7 +193,7 @@ int sctp_stream_init_ext(struct sctp_stream *stream, __u16 sid)
193193 soute = kzalloc (sizeof (* soute ), GFP_KERNEL );
194194 if (!soute )
195195 return - ENOMEM ;
196- stream -> out [ sid ]. ext = soute ;
196+ SCTP_SO ( stream , sid ) -> ext = soute ;
197197
198198 return sctp_sched_init_sid (stream , sid , GFP_KERNEL );
199199}
@@ -205,7 +205,7 @@ void sctp_stream_free(struct sctp_stream *stream)
205205
206206 sched -> free (stream );
207207 for (i = 0 ; i < stream -> outcnt ; i ++ )
208- kfree (stream -> out [ i ]. ext );
208+ kfree (SCTP_SO ( stream , i ) -> ext );
209209 kfree (stream -> out );
210210 kfree (stream -> in );
211211}
@@ -215,12 +215,12 @@ void sctp_stream_clear(struct sctp_stream *stream)
215215 int i ;
216216
217217 for (i = 0 ; i < stream -> outcnt ; i ++ ) {
218- stream -> out [ i ]. mid = 0 ;
219- stream -> out [ i ]. mid_uo = 0 ;
218+ SCTP_SO ( stream , i ) -> mid = 0 ;
219+ SCTP_SO ( stream , i ) -> mid_uo = 0 ;
220220 }
221221
222222 for (i = 0 ; i < stream -> incnt ; i ++ )
223- stream -> in [ i ]. mid = 0 ;
223+ SCTP_SI ( stream , i ) -> mid = 0 ;
224224}
225225
226226void sctp_stream_update (struct sctp_stream * stream , struct sctp_stream * new )
@@ -273,8 +273,8 @@ static bool sctp_stream_outq_is_empty(struct sctp_stream *stream,
273273 for (i = 0 ; i < str_nums ; i ++ ) {
274274 __u16 sid = ntohs (str_list [i ]);
275275
276- if (stream -> out [ sid ]. ext &&
277- !list_empty (& stream -> out [ sid ]. ext -> outq ))
276+ if (SCTP_SO ( stream , sid ) -> ext &&
277+ !list_empty (& SCTP_SO ( stream , sid ) -> ext -> outq ))
278278 return false;
279279 }
280280
@@ -361,11 +361,11 @@ int sctp_send_reset_streams(struct sctp_association *asoc,
361361 if (out ) {
362362 if (str_nums )
363363 for (i = 0 ; i < str_nums ; i ++ )
364- stream -> out [ str_list [i ]]. state =
364+ SCTP_SO ( stream , str_list [i ]) -> state =
365365 SCTP_STREAM_CLOSED ;
366366 else
367367 for (i = 0 ; i < stream -> outcnt ; i ++ )
368- stream -> out [ i ]. state = SCTP_STREAM_CLOSED ;
368+ SCTP_SO ( stream , i ) -> state = SCTP_STREAM_CLOSED ;
369369 }
370370
371371 asoc -> strreset_chunk = chunk ;
@@ -380,11 +380,11 @@ int sctp_send_reset_streams(struct sctp_association *asoc,
380380
381381 if (str_nums )
382382 for (i = 0 ; i < str_nums ; i ++ )
383- stream -> out [ str_list [i ]]. state =
383+ SCTP_SO ( stream , str_list [i ]) -> state =
384384 SCTP_STREAM_OPEN ;
385385 else
386386 for (i = 0 ; i < stream -> outcnt ; i ++ )
387- stream -> out [ i ]. state = SCTP_STREAM_OPEN ;
387+ SCTP_SO ( stream , i ) -> state = SCTP_STREAM_OPEN ;
388388
389389 goto out ;
390390 }
@@ -418,7 +418,7 @@ int sctp_send_reset_assoc(struct sctp_association *asoc)
418418
419419 /* Block further xmit of data until this request is completed */
420420 for (i = 0 ; i < stream -> outcnt ; i ++ )
421- stream -> out [ i ]. state = SCTP_STREAM_CLOSED ;
421+ SCTP_SO ( stream , i ) -> state = SCTP_STREAM_CLOSED ;
422422
423423 asoc -> strreset_chunk = chunk ;
424424 sctp_chunk_hold (asoc -> strreset_chunk );
@@ -429,7 +429,7 @@ int sctp_send_reset_assoc(struct sctp_association *asoc)
429429 asoc -> strreset_chunk = NULL ;
430430
431431 for (i = 0 ; i < stream -> outcnt ; i ++ )
432- stream -> out [ i ]. state = SCTP_STREAM_OPEN ;
432+ SCTP_SO ( stream , i ) -> state = SCTP_STREAM_OPEN ;
433433
434434 return retval ;
435435 }
@@ -609,10 +609,10 @@ struct sctp_chunk *sctp_process_strreset_outreq(
609609 }
610610
611611 for (i = 0 ; i < nums ; i ++ )
612- stream -> in [ ntohs (str_p [i ])]. mid = 0 ;
612+ SCTP_SI ( stream , ntohs (str_p [i ])) -> mid = 0 ;
613613 } else {
614614 for (i = 0 ; i < stream -> incnt ; i ++ )
615- stream -> in [ i ]. mid = 0 ;
615+ SCTP_SI ( stream , i ) -> mid = 0 ;
616616 }
617617
618618 result = SCTP_STRRESET_PERFORMED ;
@@ -683,11 +683,11 @@ struct sctp_chunk *sctp_process_strreset_inreq(
683683
684684 if (nums )
685685 for (i = 0 ; i < nums ; i ++ )
686- stream -> out [ ntohs (str_p [i ])]. state =
686+ SCTP_SO ( stream , ntohs (str_p [i ])) -> state =
687687 SCTP_STREAM_CLOSED ;
688688 else
689689 for (i = 0 ; i < stream -> outcnt ; i ++ )
690- stream -> out [ i ]. state = SCTP_STREAM_CLOSED ;
690+ SCTP_SO ( stream , i ) -> state = SCTP_STREAM_CLOSED ;
691691
692692 asoc -> strreset_chunk = chunk ;
693693 asoc -> strreset_outstanding = 1 ;
@@ -786,11 +786,11 @@ struct sctp_chunk *sctp_process_strreset_tsnreq(
786786 * incoming and outgoing streams.
787787 */
788788 for (i = 0 ; i < stream -> outcnt ; i ++ ) {
789- stream -> out [ i ]. mid = 0 ;
790- stream -> out [ i ]. mid_uo = 0 ;
789+ SCTP_SO ( stream , i ) -> mid = 0 ;
790+ SCTP_SO ( stream , i ) -> mid_uo = 0 ;
791791 }
792792 for (i = 0 ; i < stream -> incnt ; i ++ )
793- stream -> in [ i ]. mid = 0 ;
793+ SCTP_SI ( stream , i ) -> mid = 0 ;
794794
795795 result = SCTP_STRRESET_PERFORMED ;
796796
@@ -979,23 +979,26 @@ struct sctp_chunk *sctp_process_strreset_resp(
979979 sizeof (__u16 );
980980
981981 if (result == SCTP_STRRESET_PERFORMED ) {
982+ struct sctp_stream_out * sout ;
982983 if (nums ) {
983984 for (i = 0 ; i < nums ; i ++ ) {
984- stream -> out [ntohs (str_p [i ])].mid = 0 ;
985- stream -> out [ntohs (str_p [i ])].mid_uo = 0 ;
985+ sout = SCTP_SO (stream , ntohs (str_p [i ]));
986+ sout -> mid = 0 ;
987+ sout -> mid_uo = 0 ;
986988 }
987989 } else {
988990 for (i = 0 ; i < stream -> outcnt ; i ++ ) {
989- stream -> out [i ].mid = 0 ;
990- stream -> out [i ].mid_uo = 0 ;
991+ sout = SCTP_SO (stream , i );
992+ sout -> mid = 0 ;
993+ sout -> mid_uo = 0 ;
991994 }
992995 }
993996
994997 flags = SCTP_STREAM_RESET_OUTGOING_SSN ;
995998 }
996999
9971000 for (i = 0 ; i < stream -> outcnt ; i ++ )
998- stream -> out [ i ]. state = SCTP_STREAM_OPEN ;
1001+ SCTP_SO ( stream , i ) -> state = SCTP_STREAM_OPEN ;
9991002
10001003 * evp = sctp_ulpevent_make_stream_reset_event (asoc , flags ,
10011004 nums , str_p , GFP_ATOMIC );
@@ -1050,15 +1053,15 @@ struct sctp_chunk *sctp_process_strreset_resp(
10501053 asoc -> adv_peer_ack_point = asoc -> ctsn_ack_point ;
10511054
10521055 for (i = 0 ; i < stream -> outcnt ; i ++ ) {
1053- stream -> out [ i ]. mid = 0 ;
1054- stream -> out [ i ]. mid_uo = 0 ;
1056+ SCTP_SO ( stream , i ) -> mid = 0 ;
1057+ SCTP_SO ( stream , i ) -> mid_uo = 0 ;
10551058 }
10561059 for (i = 0 ; i < stream -> incnt ; i ++ )
1057- stream -> in [ i ]. mid = 0 ;
1060+ SCTP_SI ( stream , i ) -> mid = 0 ;
10581061 }
10591062
10601063 for (i = 0 ; i < stream -> outcnt ; i ++ )
1061- stream -> out [ i ]. state = SCTP_STREAM_OPEN ;
1064+ SCTP_SO ( stream , i ) -> state = SCTP_STREAM_OPEN ;
10621065
10631066 * evp = sctp_ulpevent_make_assoc_reset_event (asoc , flags ,
10641067 stsn , rtsn , GFP_ATOMIC );
@@ -1072,7 +1075,7 @@ struct sctp_chunk *sctp_process_strreset_resp(
10721075
10731076 if (result == SCTP_STRRESET_PERFORMED )
10741077 for (i = number ; i < stream -> outcnt ; i ++ )
1075- stream -> out [ i ]. state = SCTP_STREAM_OPEN ;
1078+ SCTP_SO ( stream , i ) -> state = SCTP_STREAM_OPEN ;
10761079 else
10771080 stream -> outcnt = number ;
10781081
0 commit comments