[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
(usagi-users 00522) Problem processing the routing header addresses
- To: usagi-users@xxxxxxxxxxxxxx
- Subject: (usagi-users 00522) Problem processing the routing header addresses
- From: SUPERJFG <SUPERJFG@xxxxxxxx>
- Date: Mon, 14 May 2001 10:27:55 +0200
- Reply-to: usagi-users@xxxxxxxxxxxxxx
Hi,
There?s a problem in processing the routing header addresses. The last
address is always ignored. I get the :: address. Has the
inet6_rthdr_getaddr function a known bug? I suspect the kernel doesn?t
return the last address, because I can see the correct packet
containing all the addresses with the tcpdump.
As an example, I show you a simplified version of my code.
struct cmsghdr *cmsgptr;
int segments, i;
struct in6_addr *in6;
char *asciiname =(char *) malloc(128*sizeof(char));
/* Call to recvmsg */
if (cmsgptr->cmsg_level == IPPROTO_IPV6 && cmsgptr->cmsg_type ==
IPV6_RTHDR ) {
segments = inet6_rthdr_segments(cmsgptr);
for (i=1; i<=segments; i++){
in6 = inet6_rthdr_getaddr(cmsgptr, i);
if(in6 == NULL){
printf("Error processing routing header\n");
return NULL;
}
else{
asciiname = (char *)inet_ntop(AF_INET6, (const void *)in6->s6_addr,
asciiname, 128);
printf(?Address %d: %s\n?, i, asciiname);
}
}
}
Thanks a lot.
___________________________________________________________________
Consigue tu e-mail gratuito TERRA.ES
Haz clic en http://www.terra.es/correo/