[Planetlab-users] A problem with running nmap. Thanks!
Neil Spring
nspring at cs.umd.edu
Thu Nov 17 09:22:45 EST 2005
You folks are going to want a better slice description if you're
planning to use nmap to send packets to hosts off-planetlab.
The code you posted that calls bind seems to only get called if
"o.spoofsource" is true, which, if it is aptly named, means you're
trying to do something planetlab vnet won't allow you to do, and if
it isn't, nmap isn't calling bind(), at least in the code excerpt
you've posted.
-neil
On Nov 17, 2005, at 3:26 AM, Xin Hu wrote:
> Hi,
>
> I am a new user of planetlab. I am trying to use nmap to do some
> experiments but encounter a problem. I hope I can get some help or
> advice from you here. Thanks!
>
>
>
> After nmap is running, it shows following error message:
>
> sendto in send_ip_packet: sendto(4, packet, 60, 0, 192.6.10.2, 16)
> => Operation not permitted
>
>
>
> I read the previous archive and found that this problem may caused
> by using raw packets which is not supported by planetlab. And I
> also read the VNET document, but still cannot solve the problem.
> Some people say that the socket must be binded to specific local
> port to send raw packet. I tried this, but it still doesn’t work.
> The binding code of nmap is:
>
>
>
> /* We set the socket lingering so we will RST connection instead of
> wasting
>
> bandwidth with the four step close */
>
> void init_socket(int sd) {
>
> struct linger l;
>
> int res;
>
> static int bind_failed=0;
>
> struct sockaddr_storage ss;
>
> size_t sslen;
>
>
>
> l.l_onoff = 1;
>
> l.l_linger = 0;
>
>
>
> if (setsockopt(sd, SOL_SOCKET, SO_LINGER, (const char *) &l,
> sizeof(struct linger)))
>
> {
>
> fprintf(stderr, "Problem setting socket SO_LINGER, errno: %d
> \n", socket_errno());
>
> perror("setsockopt");
>
> }
>
> if (o.spoofsource && !bind_failed)
>
> {
>
> o.SourceSockAddr(&ss, &sslen);
>
> res=bind(sd, (struct sockaddr*)&ss, sslen);
>
> if (res<0)
>
> {
>
> fprintf(stderr, "init_socket: Problem binding source
> address (%s), errno :%d\n", inet_socktop(&ss), socket_errno());
>
> perror("bind");
>
> bind_failed=1;
>
> }
>
> }
>
> }
>
>
>
>
>
> Can anybody give me some advice on how to solve this problem? Thank
> you very much! Any suggestions would be greatly appreciated!
>
>
>
> Sincerely yours,
>
> Xin Hu
>
>
>
> _______________________________________________
> Users mailing list: Users at lists.planet-lab.org
> https://lists.planet-lab.org/mailman/listinfo/users
More information about the Users
mailing list