[Planetlab-users] my problem about ICMP raw sockest.

TIAN Rui-xiong rxtian at ns.6test.edu.cn
Mon Jun 7 10:46:57 EDT 2004


Sorry to bother you. I have a question about ICMP raw socket.
my souce code is:
       recvfd = socket(PF_INET, SOCK_RAW, IPPROTO_ICMP);^M
        if(recvfd == -1)^M
        {
                printf("Error, cannot establish ICMP receiver socket!\n");^M
                return -1;^M
        }

        sabind.sin_port = htons(sport);
        if(bind(recvfd, (struct sockaddr*)&sabind, sizeof(struct sockaddr))  != 0 )^M
        {

                printf("port num=%d.\n",ntohs(sabind.sin_port));
                printf("bind error:%s.\n",strerror(errno));^M
                return -1;
        }

and the result is:
bind error. It says that the address is used.
What's the problem and how can I fix it. thanks.

By the way, I've known that a site can show the rtt values between all the Planet-Lab nodes. Where is it? Thanks a lot.



More information about the Users mailing list