SCTP Discussions

Text archives Help


AW: [SCTP-Discussion] problem when establishing association with -pre11


Chronological Thread 
  • From: Held Martin ICM N MC MI E6 <Martin.Held AT icn.siemens.de>
  • To: "'discussion AT sctp.de'" <discussion AT sctp.de>
  • Subject: AW: [SCTP-Discussion] problem when establishing association with -pre11
  • Date: Fri Jun 8 14:06:00 2001
  • List-id: SCTP Discussions <discussion.sctp.de>

Hi Michael and all,

thanks for making the addressing issue fairly clear.


Now coming back to the initial problem with the destination address. Below
is a gdb trace of adl_receive_message (adaptation.c, around line 734).
We can see that rmsghdr.msg_control is NOT filled by the recvmsg call. Thus
the

memcpy(&(to->sin6.sin6_addr), &(pkt6info->ipi6_addr), sizeof(struct
sockaddr_in6));

in line 741 accesses just uninitialized memory which explains the corrupted
destination address.

Regards,
Martin




726 memset (from, 0, sizeof (struct sockaddr_in6));
(gdb)
730 addr_len = sizeof (struct sockaddr_in6);
(gdb)
731 len = recvfrom(sfd,dest, 0 ,MSG_PEEK, (struct
sockaddr*)from,&addr_len);
(gdb) p rmsghdr
$10 = {msg_name = 0xbfbfee48, msg_namelen = 28, msg_iov = 0xbfbfee20,
msg_iovlen = 1, msg_control = 0xbfbfee28, msg_controllen = 32, msg_flags =
1}
(gdb) p m6buf
$11 = "
\000\000\000)\000\000\000\023\000\000\000\005\000\000\000tî¿¿\020'\000\000\2
00î¿¿ÑÜ\023("
(gdb) n
734 len = recvmsg (sfd, &rmsghdr, 0);
(gdb)
736 from->sa.sa_family = AF_INET6;
(gdb) p rmsghdr
$12 = {msg_name = 0xbfbfee48, msg_namelen = 28, msg_iov = 0xbfbfee20,
msg_iovlen = 1, msg_control = 0xbfbfee28, msg_controllen = 0, msg_flags =
0}
(gdb) p m6buf
$13 = "
\000\000\000)\000\000\000\023\000\000\000\005\000\000\000tî¿¿\020'\000\000\2
00î¿¿ÑÜ\023("
(gdb) n
738 to->sa.sa_family = AF_INET6;
(gdb)
739 to->sin6.sin6_port = htons(0);
(gdb)
740 to->sin6.sin6_flowinfo = htonl(0);
(gdb)




Archive powered by MHonArc 2.6.19+.

Top of page