[Babel-users] babel-pinger

Michael Grant mgrant at grant.org
Sun Nov 1 22:13:19 UTC 2009


> Perhaps I missing some library which helps babel-pinger create the dns
> and icmp requests?

I looked at the code, in fact, it doesn't do icmp echo requests, it
does tcp echo requests on port 7.  But I'm confused, why does it work
for ntp but not for echo and dns?  The code is very simple, it just
literally creates a simple echo, ntp, or dns packet in a buffer and
sends it out.  I don't see why this would work for ntp but not for the
other two protocols.

            if(servers[i].protocol == SERVER_ECHO) {
                /* Empty datagram */
                len = 0;
            } else if(servers[i].protocol == SERVER_DNS) {
                /* A query with qdcount = 0 */
                unsigned short id = random() & 0xFFFF;
                memset(buf, 0, 12);
                buf[0] = id >> 8;
                buf[1] = id & 0xFF;
                len = 12;
            } else if(servers[i].protocol == SERVER_NTP) {
                /* A version 3 client request with all fields set to 0 */
                memset(buf, 0, 48);
                buf[0] = 0x1b;
                len = 48;
            } else {
                abort();
            }


It's as if somehow the tcp-echo and dns packets this code above
creates are mal-formed and the kernel does the arp request, but then
drops the packet on the floor.

Michael Grant



More information about the Babel-users mailing list