Nmap Development mailing list archives

Re: Nmap bug - Doesn't folow static route


From: jrf <jay.fink () gmail com>
Date: Fri, 12 Mar 2010 16:35:48 -0500

On Fri, Mar 12, 2010 at 10:20:20AM -0700, David Fifield wrote:

I looked at that, and actually we use route_loop on non-Linux platforms,
but the struct returned by that function is

struct route_entry {
        struct addr     route_dst;      /* destination address */
        struct addr     route_gw;       /* gateway address */
};

It doesn't have the gateway bit, the "G" flag in netstat. It looks like
this bit is called RTF_GATEWAY.

I think so yes, I found some mailing lists that discuss it but I'm not
sure if that is the default or the gateway for that route (yet...)

Grep in dnet shows it too:

[16:30:05 jrf@argos:~/src/libdnet/src]$ grep RTF_GATEWAY *
arp-bsd.c:                  (msg.rtm.rtm_flags & RTF_GATEWAY) != 0) {
arp-bsd.c:                  (msg.rtm.rtm_flags & RTF_GATEWAY) != 0) {
route-bsd.c:            rtm->rtm_flags |= RTF_GATEWAY;
route-bsd.c:    gp->gi_arg = RTF_UP | RTF_GATEWAY;
route-hpux.c:   rt.rt_flags = RTF_UP | RTF_GATEWAY;
route-linux.c:  rt.rt_flags = RTF_UP | RTF_GATEWAY;

I'll keep looking.
It must be there somewhere because on my freebsd box I see a G field:

[16:35:31 jrf@vela:~]$ netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif
Expire
default            192.168.1.1        UGS         0    16335    em0
127.0.0.1          127.0.0.1          UH          0       74    lo0
192.168.1.0/24     link#1             UC          0        0    em0
192.168.1.1        00:1f:33:c1:9d:fe  UHLW        2       20    em0
1177
192.168.1.6        00:1e:c9:7f:00:c6  UHLW        1    53693    em0
1179
192.168.1.10       00:0c:29:6b:4f:ae  UHLW        1     2385    lo0


_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: