SCTP Discussions

Text archives Help


Re: [SCTP-Discussion] Bug in bundling .c


Chronological Thread 
  • From: Marc Boucher <marc+sctp AT mbsi.ca>
  • To: discussion AT sctp.de
  • Subject: Re: [SCTP-Discussion] Bug in bundling .c
  • Date: Thu Apr 5 12:41:01 2001
  • List-id: SCTP Discussions <discussion.sctp.de>

how about simply zeroing the whole thing after allocation
this way if fields are added to the struct in the future they will be
automatically initialized to zero/FALSE.

--- sbundling.c 2001/04/05 10:23:22 1.1
+++ sbundling.c 2001/04/05 10:24:16
@@ -120,15 +120,13 @@
error_log(ERROR_MAJOR, "Malloc failed");
return 0;
}
+
+ memset(ptr, '\0', sizeof(sizeof(bundling_instance)));
+
ptr->ctrl_position = sizeof(SCTP_common_header); /* start adding data
after that header ! */
ptr->data_position = sizeof(SCTP_common_header); /* start adding data
after that header ! */
ptr->sack_position = sizeof(SCTP_common_header); /* start adding data
after that header ! */

- ptr->data_in_buffer = FALSE;
- ptr->ctrl_chunk_in_buffer = FALSE;
- ptr->sack_in_buffer = FALSE;
- ptr->got_send_request = FALSE;
- ptr->locked = FALSE;
return ptr;
}


On Thu, Apr 05, 2001 at 09:40:00AM +0200, Schruefer Wolfgang wrote:
> Folks,
>
> I had problems when sending because the datastructure of the
> bundling_instance in bundlung.c was not initialized (here it was
> bu_ptr->got_send_address).
> So I inserted the following lines in function bu_new() ...
>
> ptr->ctrl_position = 0;
> ptr->sack_position = 0;
> ptr->data_position = 0;
> ptr->treating_received_chunks = FALSE;
> ptr->got_sack_request = FALSE;
> ptr->got_send_address = FALSE;
> ptr->got_sack = FALSE;
> ptr->got_shutdown = FALSE;
> ptr->requested_destination = 0;
>
> Viele Gruesse
> Wolfgang Schruefer
>
> **************************************
> Wolfgang Schrüfer SIEMENS AG
> ICN WN CC EKJ 14 TEL: +49 89 722-61646
> mailto:Wolfgang.Schruefer AT icn.siemens.de
> **************************************
>
> _______________________________________________
> discussion mailing list
> discussion AT sctp.de
> http://www.sctp.de/mailman/listinfo/discussion
>




Archive powered by MHonArc 2.6.19+.

Top of page