Subject: bin/22569: route6d not advertising local routes when split horizon enabled
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <andrew.e.white@motorola.com>
List: netbsd-bugs
Date: 08/22/2003 07:48:03
>Number:         22569
>Category:       bin
>Synopsis:       route6d not advertising local routes when split horizon enabled
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 22 07:49:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Andrew White
>Release:        1.6
>Organization:
MARC
>Environment:
NetBSD gateway.private.arpa. 1.6 NetBSD 1.6 (GENERIC) #2: Mon Jun 23 13:49:32 EST 2003     root@conan.testbed.arc.corp.mot.com.:/asy/awhite/netbsd/obj/sys/arch/i386/compile/GENERIC i386

>Description:
route6d doesn't seem to advertise routes to interfaces on the same link when split horizon is enabled.
>How-To-Repeat:
Set-up two boxes.  For the demo, set:

B1:
lo0: fec0:0:1:1::1 /64
intf0: fec0:0:1:2::1 / 64

B2:
lo0: fec0:0:2:1::1 /64
intf0: fec0:0:2:2::1 / 64

Connect intf0 on both boxes.  Run 'route6d -l'.

Usually, the lo0 routes will be exchanged but the intf0 routes will not.
>Fix:
rrt data structure doesn't seem to make distinction between routes that are local to this interface because they live on this interface and those that are local because they were received on this interface.  We need to advertise routes on this interface regardless of split horizon.

In tobeadv (around line 930):

In split horizon tests, change to:

  if (! sflag)
    return 0;
  if (rrt->rrt_index == ifcp->ifc_index && rrt->rrt_t > 0)
    return 0;
  return 1;

and then

  if (hflag == 0 && rrt->rrt_index == ifcp->ifc_index && rrt_t > 0)
    return 0;
  return 1;

(incidentally, these lines could be rewritten as

  if (! sflag)
    return 0;
  return (rrt->rrt_index != ifcp->ifc_index
    || rrt->rrt_t == 0);
    /* test split horizon */

and

  /* Regular split horizon */
  return (hflag
    || rrt->rrt_index != ifcp->ifc_index
    || rrt->rrt_t == 0);


or similar)
>Release-Note:
>Audit-Trail:
>Unformatted: