Design idea for Ping Application

David M. Cooke cookedm+news at physics.mcmaster.ca
Fri Aug 22 15:58:21 EDT 2003


At some point, "Mike C. Fletcher" <mcfletch at rogers.com> wrote:
> David M. Cooke wrote:
>>At some point, "Mike C. Fletcher" <mcfletch at rogers.com> wrote:
>>
> ...
>
>>>however, I've not yet been
>>>able to get the code to run under Unix (where creating raw sockets is
>>>a no-no).
>>>
>>
>>Only root can create raw sockets. You'll notice the system ping
>>command is setuid root so that ordinary users can use it. Running this
>>code as root works.
>>
> ...
> Oh well, bite the bullet and make it a setuid-safe program and
> figure out how to get that installed on client machines. Or just
> scrap the whole direct approach on Unix and spawn 100 "ping"
> processes simultaneously.

Problem there is there are different versions of ping. There are three
versions available for Debian, for instance. With Redhat 7.x, the
times are returned as microseconds, whereas others return
milliseconds. The ping on Solaris, IIRC, by default just checks if a
system is up. So you end up trying to figure out what version of ping
you have, and how to call it correctly.

-- 
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca




More information about the Python-list mailing list