Browse code

sctp minor fix

- ancillary data worked only the first time (msg_control was intialized
only once)

Andrei Pelinescu-Onciul authored on 27/08/2008 08:38:08
Showing 1 changed files
... ...
@@ -471,8 +471,6 @@ int sctp_rcv_loop()
471 471
 	iov[0].iov_len=BUF_SIZE;
472 472
 	msg.msg_iov=iov;
473 473
 	msg.msg_iovlen=1;
474
-	msg.msg_control=cbuf;
475
-	msg.msg_controllen=sizeof(cbuf);
476 474
 	msg.msg_flags=0;
477 475
 	
478 476
 
... ...
@@ -482,6 +480,8 @@ int sctp_rcv_loop()
482 482
 	for(;;){
483 483
 		msg.msg_name=&ri.src_su.s;
484 484
 		msg.msg_namelen=sockaddru_len(bind_address->su);
485
+		msg.msg_control=cbuf;
486
+		msg.msg_controllen=sizeof(cbuf);
485 487
 
486 488
 		len=recvmsg(bind_address->socket, &msg, 0);
487 489
 		/* len=sctp_recvmsg(bind_address->socket, buf, BUF_SIZE, &ri.src_su.s,
... ...
@@ -521,10 +521,12 @@ int sctp_rcv_loop()
521 521
 						) && (cmsg->cmsg_len>=CMSG_LEN(sizeof(*sinfo)))) ){
522 522
 				sinfo=(struct sctp_sndrcvinfo*)CMSG_DATA(cmsg);
523 523
 				DBG("sctp recv: message from %s:%d stream %d  ppid %x"
524
-						" flags %x tsn %d" " cumtsn %d associd %d\n",
524
+						" flags %x%s tsn %u" " cumtsn %u associd %d\n",
525 525
 						ip_addr2a(&ri.src_ip), htons(ri.src_port),
526 526
 						sinfo->sinfo_stream, sinfo->sinfo_ppid,
527 527
 						sinfo->sinfo_flags,
528
+						(sinfo->sinfo_flags&SCTP_UNORDERED)?
529
+							" (SCTP_UNORDERED)":"",
528 530
 						sinfo->sinfo_tsn, sinfo->sinfo_cumtsn, 
529 531
 						sinfo->sinfo_assoc_id);
530 532
 				break;