Re: arp_rtrequest() panich & patch for comments

From: Bruce M Simpson (bms_at_spc.org)
Date: 10/26/04

  • Next message: Bruce M Simpson: "Re: cvs commit: src/sys/netinet if_ether.c"
    Date: Mon, 25 Oct 2004 20:27:47 -0700
    To: Iasen Kostov <tbyte@OTEL.net>
    
    
    

    Hi,

    Can you please contact me off-list with more information about your
    Zebra configuration?

    On Mon, Oct 25, 2004 at 07:12:18PM +0300, Iasen Kostov wrote:
    > if ((rt->rt_flags & RTF_HOST) == 0 &&
    > + rt_mask(rt) != NULL &&
    > SIN(rt_mask(rt))->sin_addr.s_addr != 0xffffffff)
    > rt->rt_flags |= RTF_CLONING;

    Good catch. This can and should be committed; it's a common sense null
    pointer check.

    > arp_rtrequest: bad gateway 192.168.100.0 (!AF_LINK)
    > 192.168.100 0.0.0.0 U1 0 0 vlan5
    > 192.168.96/20 link#6 UC 0 0 vlan5

    192.168.100.0/24 is a subnet of 192.168.96/20. Was the /20 there before?

    The 1 flag is set in the case of the 192.168.100.0 route, so it is
    being added by Quagga/Zebra somehow, and doesn't have the WASCLONED
    flag set. Also, the LLINFO flag is not set.

    There's clearly an interaction going on here between a more specific
    non-cloning network route and a more general cloning network route.

    > possibly is not right. And if the interface tun0 exists
    > everything is as it should be:
    >
    > 192.168.100 tun0 U1 0 0 tun0

    This is the correct line that I'd expect for an interface route
    to a network, which has the PROTO1 flag set, and is not static, and
    has no link-layer information (is not an ARP entry).

    Zebra is trying to add the route when the interface doesn't exist.
    So the RTF_GATEWAY flag should be cleared (as per route(8)) and a
    sockaddr_dl containing *the name of the interface* should be sent in
    the rtmsg. From the looks of the Zebra code, it does this. However
    you should run route(8) in monitor mode and watch the routing socket
    to be absolutely sure.

    > but whatever is the case - user space program should not be able to
    > panic the kernel so easy ...
    > I don't know where really the bug is - in arp_rtrequest() or somewhere
    > in the pipe that at the end calls arp_rtrequest().

    Trying to walk through the code, I don't see RTF_ANNOUNCE being set anywhere
    in the kernel so that part in arp_rtrequest() can probably be skipped.

    Back in userland, the quagga/zebra call graph looks like this:
            rt_socket.c:kernel_add_ipv4()
             rt_socket.c:kernel_rtm_ipv4(RTM_ADD, p, rib, AF_INET);
              rtm_write(...)

    Not knowing more about your Zebra config it's difficult to do more.

    It is more than likely that Zebra is passing the wrong interface index
    to its rtm_write() function and this results in the inconsistency you see.

    BMS

    
    



  • Next message: Bruce M Simpson: "Re: cvs commit: src/sys/netinet if_ether.c"

    Relevant Pages

    • Howto zebra,balansing?
      ... For providing uninterrupted network performance, ... channel connection with ADSL modem, added routes, installed zebra package. ... interface xl0 ... ip route 192.168.165.0/24 gif0 ...
      (freebsd-questions)
    • Re: Cant ping router.
      ... standard loopback interface on address 127.0.0.1 ... This line indicates that traffic intended for the host (H flag is on) ... look up the Unix 'route' command. ...
      (comp.sys.acorn.networking)
    • Re: problems adding interfaces with zebra
      ... >> Because the route is already installed locally as pointing to machine A via ... > interface: fxp0 ... the route is re-added by zebra :-( So I would have to kill ... packets transmitted, 0 packets received, 100% packet loss ...
      (freebsd-net)
    • Re: Using FreeBSD as a router
      ... SS> I'm using the port quagge (zebra spin-off) in order to run bgp ... SS> The aim is to configure a static default with a next-hop of a/b. ... SS> I use 'route default a/b' which actually shows up in 'netstat -rnf inet' ... configure your zebra/quagga router app by making changes in it's ...
      (freebsd-isp)
    • BGP troubleshooting help
      ... Hello - I'm new to BGP, however I know the basics of what it does. ... playing with it using Zebra (actually Quagga packaged with Fedora Core ... Zebra4 is neighbor to 1 ... description Boeing Intranet Interface ...
      (comp.os.linux.networking)