From: <st...@us...> - 2003-06-19 14:02:32
|
Update of /cvsroot/iaxclient/iaxclient/lib/libiax2/src In directory sc8-pr-cvs1:/tmp/cvs-serv14855 Modified Files: iax.c Log Message: different fixes for same bugs (merge with Mark). Index: iax.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/libiax2/src/iax.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- iax.c 12 Jun 2003 19:03:31 -0000 1.6 +++ iax.c 19 Jun 2003 14:02:29 -0000 1.7 @@ -613,7 +613,10 @@ or delayed, with retransmission */ struct ast_iax2_full_hdr *fh; struct ast_iax2_mini_hdr *mh; - double buffer[4096]; /* Buffer -- we use this for a frame later, double might ensure proper alignment? */ + struct { + struct iax_frame fr2; + unsigned char buffer[4096]; /* Buffer -- must preceed fr2 */ + } buf; struct iax_frame *fr; int res; int sendmini=0; @@ -621,7 +624,7 @@ unsigned int fts; /* Shut up GCC */ - buffer[0] = 0; + buf.buffer[0] = 0; if (!pvt) { IAXERROR "No private structure for packet?\n"); @@ -645,7 +648,7 @@ } /* Allocate an iax_frame */ if (now) { - fr = (struct iax_frame *)&buffer; + fr = &buf.fr2; } else fr = iax_frame_new(DIRECTION_OUTGRESS, f->datalen); if (!fr) { @@ -1656,7 +1659,7 @@ return cur; cur = cur->next; } - if (makenew && (dcallno == -1)) { + if (makenew && !dcallno) { cur = iax_session_new(); cur->peercallno = callno; cur->peeraddr.sin_addr.s_addr = sin->sin_addr.s_addr; @@ -2280,7 +2283,6 @@ struct ast_iax2_mini_hdr *mh = (struct ast_iax2_mini_hdr *)buf; struct iax_session *session; - /* THIS IS BAD: buf[len - 1] = '\0'; */ if (ntohs(fh->scallno) & IAX_FLAG_FULL) { /* Full size header */ if (len < sizeof(struct ast_iax2_full_hdr)) { |