]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
9 years agoAddpath does not work for soft-reconfiguration
Donald Sharp [Wed, 20 May 2015 01:04:01 +0000 (18:04 -0700)]
Addpath does not work for soft-reconfiguration

9 years agoUse #define for mp_nexthop_len values
Donald Sharp [Wed, 20 May 2015 01:04:00 +0000 (18:04 -0700)]
Use #define for mp_nexthop_len values

9 years agoEnsure that during event-driven route-map processing, the peer status is
Donald Sharp [Wed, 20 May 2015 01:04:00 +0000 (18:04 -0700)]
Ensure that during event-driven route-map processing, the peer status is
considered, if required. Attempting to do certain processing while the
peer is not Established can lead to errors.

9 years agoIf on-shutdown is configured to a large value and 'service quagga restart'
Donald Sharp [Wed, 20 May 2015 01:03:59 +0000 (18:03 -0700)]
If on-shutdown is configured to a large value and 'service quagga restart'
is executed, then the init.d/quagga script doesnt wait more than 120 seconds
for the daemon do stop, worse, it goes ahead and starts the new daemon
regardless. This can result into two ospfd processes running on the same config.
Which leads to many issues including but not limited to high cpu usage.
Thats because the two processes are mixing packets on adjancencies thus
causing churn on the box and network.

As long as OSPF is able to reliably send the max-metric router-lsa before
exiting thats mostly good enough for this purpose anyways.

As a solution to this situation, bringing the maximum configurable value of
the on-shutdown timer below the maximum retry to stop a daemon in init.d/quagga

Notes: This may not be an upstreamable patch, still we needed to find
a solution for init.d/quagga and this command this co-exist.

9 years agoDuring update-delay, route withdraws to zebra should not be kept on hold,
Donald Sharp [Wed, 20 May 2015 01:03:59 +0000 (18:03 -0700)]
During update-delay, route withdraws to zebra should not be kept on hold,
because BGP may have pending withdraws from the peers going phase.

9 years agoPaths with global and link-local nexthops should be considered for multipath
Donald Sharp [Wed, 20 May 2015 01:03:59 +0000 (18:03 -0700)]
Paths with global and link-local nexthops should be considered for multipath

9 years agoAdd a no-as-set option to multipath-relax
Donald Sharp [Wed, 20 May 2015 01:03:58 +0000 (18:03 -0700)]
Add a no-as-set option to multipath-relax

9 years agoInstall aggregate routes we create in the RIB
Donald Sharp [Wed, 20 May 2015 01:03:58 +0000 (18:03 -0700)]
Install aggregate routes we create in the RIB

9 years agoIPv6 RA debugs are too chatty
Donald Sharp [Wed, 20 May 2015 01:03:57 +0000 (18:03 -0700)]
IPv6 RA debugs are too chatty

9 years agoThe column headers for displaying OSPF neighbors are not aligned
Donald Sharp [Wed, 20 May 2015 01:03:57 +0000 (18:03 -0700)]
The column headers for displaying OSPF neighbors are not aligned

9 years agoRelax draft-ietf-idr-error-handling-13 valid IP check in favor of draft-ietf-idr...
Donald Sharp [Wed, 20 May 2015 01:03:56 +0000 (18:03 -0700)]
Relax draft-ietf-idr-error-handling-13 valid IP check in favor of draft-ietf-idr-error-handling-14

9 years agoAlways add a keepalive to the OutQ when the KA timer expires
Donald Sharp [Wed, 20 May 2015 01:03:56 +0000 (18:03 -0700)]
Always add a keepalive to the OutQ when the KA timer expires

9 years agoCheck for overflow when RXing NLRI with addpath
Donald Sharp [Wed, 20 May 2015 01:03:56 +0000 (18:03 -0700)]
Check for overflow when RXing NLRI with addpath

9 years agoThe 'show ip bgp json' output is incorrect if the aspath is empty
Donald Sharp [Wed, 20 May 2015 01:03:55 +0000 (18:03 -0700)]
The 'show ip bgp json' output is incorrect if the aspath is empty

9 years agobgpd-ensure-fast-eor-send.patch
Donald Sharp [Wed, 20 May 2015 01:03:55 +0000 (18:03 -0700)]
bgpd-ensure-fast-eor-send.patch

BGP: Ensure EOR is always sent immediately after all prefixes have been adv.

Its possible that EOR send is delayed until the next KeepAlive timer fires.
This can happen when the send update iteration precisely matches the last
update packet sent. After this since there are no more updates to be sent,
no write thread is setup, but there's still the EOR to be sent. Therefore,
EOR is not sent right away causing some neighbors to not exit RO mode and
delaying convergence overall. This patch ensures that EOR is sent at the end
of all updates on startup.

Signed-off-by: Vivek Venkataraman <vivek@cumulusnetworks.com>
Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
9 years agoAdd a running flag in ospf instance.
Donald Sharp [Wed, 20 May 2015 01:03:54 +0000 (18:03 -0700)]
Add a running flag in ospf instance.
set/reset it on 'router ospf [<instance>]'/'no router ospf [<instance>]'

9 years agoEnsure connected nexthop entry for the peer is freed when the peer is freed.
Donald Sharp [Wed, 20 May 2015 01:03:54 +0000 (18:03 -0700)]
Ensure connected nexthop entry for the peer is freed when the peer is freed.

9 years agoEnsure that if 'update-source <interface>' is specified, that interface is
Donald Sharp [Wed, 20 May 2015 01:03:54 +0000 (18:03 -0700)]
Ensure that if 'update-source <interface>' is specified, that interface is
chosen as the source for the local nexthops. Otherwise, do a complete
match on the local IP address of the connection to determine the source
interface for the local nexthops; this will handle scenarios where there
is an overlap of subnets between interfaces (e.g., loopback and another
interface).

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
9 years agoAdding the initialization check in ospfv3_clean()
Donald Sharp [Wed, 20 May 2015 01:03:53 +0000 (18:03 -0700)]
Adding the initialization check in ospfv3_clean()

This is to avoid a crash triggered by process termination
when ospf6d daemon is running and 'router ospf6' config has not been done yet.

Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
9 years agoFixing a couple of issues with ospf6_route_remove () routine.
Donald Sharp [Wed, 20 May 2015 01:03:53 +0000 (18:03 -0700)]
Fixing a couple of issues with ospf6_route_remove () routine.

When a route_node has multiple ospf6_routes under it (common subnet case),
then the current implementation has an issue in adjusting the route_node->info
on a ospf6_route_remove() call.

The main reason is that it ends up using exact match to determine if the next
ospf6_route belongs to the same route_node or not. Fixing that part to use
rnode (the existing back-pointer to the route_node) from the ospf6_route to
determine that.

Also fixing some of the walks to turn them safe so that the route deletion is
fine.

Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
9 years agoA peer's advertisement-interval is reset if you change the peer's remote-as
Donald Sharp [Wed, 20 May 2015 01:03:52 +0000 (18:03 -0700)]
A peer's advertisement-interval is reset if you change the peer's remote-as

9 years agoIf we RX an OPEN with a bad ASN the NOTIFICATION we send should include the ASN
Donald Sharp [Wed, 20 May 2015 01:03:52 +0000 (18:03 -0700)]
If we RX an OPEN with a bad ASN the NOTIFICATION we send should include the ASN

9 years agoProcess and/or announce existing routes when a prefix-list, distribute-
Donald Sharp [Wed, 20 May 2015 01:03:52 +0000 (18:03 -0700)]
Process and/or announce existing routes when a prefix-list, distribute-
list or filter-list is applied (added or removed) against a neighbor or
peer group. This makes the behavior inline with other configuration changes
such as add or remove of route-map against a neighbor or change of other
settings such as next-hop-self or as-override.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Vipin Kumar <vipin@cumulusnetworks.com>
9 years agoLA (local-address) bit related inter-op fix.
Donald Sharp [Wed, 20 May 2015 01:03:51 +0000 (18:03 -0700)]
LA (local-address) bit related inter-op fix.

As per the RFC, when the NU bit is set, prefix should be ignored.
However, the code is currently ignoring prefix with LA bit too.

Fixing that part.

In future, we should also set LA bit for the loopback addresses. Not doing this
part right away, as quagga wont be backward compatible with its own previous
releases. Maybe after a release or so, we should start setting LA bit too.

Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
9 years agoEnsure that routes from a peer are not considered for best path
Donald Sharp [Wed, 20 May 2015 01:03:51 +0000 (18:03 -0700)]
Ensure that routes from a peer are not considered for best path
comparison if the peer is not in an Established state. There can
be a window between a peer being deleted and the background
thread that actually clears the routes (marks them as "removed")
runs during which best path may run. If this path selection
compared two prefixes all the way down to peer IP addresses and
one of these two peers had just been deleted, that peer would
not have its sockunion structures, especially su_remote, resulting
in a BGPD exception.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
9 years agoMake OSPF compliant to the last sentence of this section in RFC 2328
Donald Sharp [Wed, 20 May 2015 01:03:50 +0000 (18:03 -0700)]
Make OSPF compliant to the last sentence of this section in RFC 2328

9.5 Sending Hello packets

Hello packets are sent out each functioning router interface.
They are used to discover and maintain neighbor
relationships.[6] On broadcast and NBMA networks, Hello Packets
are also used to elect the Designated Router and Backup
Designated Router.
The format of an Hello packet is detailed in Section A.3.2.  The
Hello Packet contains the router's Router Priority (used in
choosing the Designated Router), and the interval between Hello
Packets sent out the interface (HelloInterval).  The Hello
Packet also indicates how often a neighbor must be heard from to
remain active (RouterDeadInterval).  Both HelloInterval and
RouterDeadInterval must be the same for all routers attached to
a common network.  The Hello packet also contains the IP address
mask of the attached network (Network Mask).  On unnumbered
point-to-point networks and on virtual links this field should
be set to 0.0.0.0.

Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
9 years agoWhen internal operations are performed (e.g., best-path selection, next-hop
Donald Sharp [Wed, 20 May 2015 01:03:50 +0000 (18:03 -0700)]
When internal operations are performed (e.g., best-path selection, next-hop
change processing etc.) that refer to the BGP instance, the correct BGP
instance must be referenced and not the default BGP instance. The default
BGP instance is the first instance on the instance list. In a scenario
where one BGP instance is deleted (through operator action such as a
"no router bgp" command) and another instance exists or is created, there
may still be events in-flight that need to be processed against the
deleted instance. Trying to process these against the default instance
is erroneous. The calls to bgp_get_default() must be limited to the user
interface (vtysh) context.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
9 years agoospfd: ospf-start-lsreq-b4-exchange.patch
Donald Sharp [Wed, 20 May 2015 01:03:50 +0000 (18:03 -0700)]
ospfd: ospf-start-lsreq-b4-exchange.patch

OSPFv2: Don't wait for state change to Exchange to start LSReq

9 years agobgpd: Disable connected check for next hop on eBGP peers
Donald Sharp [Wed, 20 May 2015 01:03:49 +0000 (18:03 -0700)]
bgpd: Disable connected check for next hop on eBGP peers

In the data center, in conjunction with next hop propagation for features
such as announcing VIP routes to load balancers and such, it is desired to
disable the connected route check even on ebgp peers with TTL of 1. This
patch is used to disable the check for all peers instead of the peer by
peer check that is currently supported. Furthermore, the existing
disable-connected-check is different from how Cisco implements this feature.
So, we add this new flag to avoid reliance on the existing flag.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
9 years agoBGP: Use the new value of dynamic capability in Open
Donald Sharp [Wed, 20 May 2015 01:03:49 +0000 (18:03 -0700)]
BGP: Use the new value of dynamic capability in Open

The value for dynamic capability used in BGP open during capability
negotiation is a deprecated value. Thus, interop with other systems
is broken. This patch fixes that by advertising both the old and new
values. This ensures interop with older versions of quagga and other
non-quagga systems.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
9 years agobgpd: Add route-map support for set ip next-hop unchanged
Donald Sharp [Wed, 20 May 2015 01:03:49 +0000 (18:03 -0700)]
bgpd: Add route-map support for set ip next-hop unchanged

In the data center, where load balancers are announced as VIPs, and eBGP
is used as the routing protocol, this feature is required to ensure that
VIP announcements can be made from anywhere the operator sees fit.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
9 years agoOSPF silently ignores 'no ip ospf hello-interval X' and 'no ip ospf hello-interval X'
Donald Sharp [Wed, 20 May 2015 01:03:48 +0000 (18:03 -0700)]
OSPF silently ignores 'no ip ospf hello-interval X' and 'no ip ospf hello-interval X'

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
9 years agoAdd json output support for a few BGP show commands
Donald Sharp [Wed, 20 May 2015 01:03:48 +0000 (18:03 -0700)]
Add json output support for a few BGP show commands

9 years agoThis patch adds support for allowing BGP to create and bring up neighbor
Donald Sharp [Wed, 20 May 2015 01:03:47 +0000 (18:03 -0700)]
This patch adds support for allowing BGP to create and bring up neighbor
sessions dynamically. The operator configures a range of neighbor addresses
to which peering is allowed. The ranges are configured as subnets and
multiple ranges are allowed. Each range is associated with a peer-group
so that additional parameters can be configured.

BGP neighbor sessions are dynamically created when connections are initiated
by remote neighbors whose addresses fall within a configured range. The
sessions are deleted when the BGP connection terminates.

A limit on the number of neighbors allowed from each range of addresses
can be specified.

IPv4 and IPv6 peering is supported. Over the peering, any of the address
families configured for the peer-group can be negotiated.

9 years agoBGP: Add dynamic update group support
Donald Sharp [Wed, 20 May 2015 01:03:47 +0000 (18:03 -0700)]
BGP: Add dynamic update group support

This patch implements the 'update-groups' functionality in BGP. This is a
function that can significantly improve BGP performance for Update generation
and resultant network convergence. BGP Updates are formed for "groups" of
peers and then replicated and sent out to each peer rather than being formed
for each peer. Thus major BGP operations related to outbound policy
application, adj-out maintenance and actual Update packet formation
are optimized.

BGP update-groups dynamically groups peers together based on configuration
as well as run-time criteria. Thus, it is more flexible than update-formation
based on peer-groups, which relies on operator configuration.

[Note that peer-group based update formation has been introduced into BGP by
Cumulus but is currently intended only for specific releases.]

From 11098af65b2b8f9535484703e7f40330a71cbae4 Mon Sep 17 00:00:00 2001
Subject: [PATCH] updgrp commits

9 years agoIf the .conf file for a process is missing have /etc/init.d/quagga touch it so we...
Donald Sharp [Wed, 20 May 2015 01:03:46 +0000 (18:03 -0700)]
If the .conf file for a process is missing have /etc/init.d/quagga touch it so we can start the process

9 years agoAdding following files:
Donald Sharp [Wed, 20 May 2015 01:03:46 +0000 (18:03 -0700)]
Adding following files:

/etc
├── quagga
│   ├── bgpd.conf
│   ├── debian.conf
│   ├── ospf6d.conf
│   ├── ospfd.conf
│   ├── vtysh.conf
│   └── zebra.conf
└── sudoers.d
    └── quagga_sudoers

9 years agoPer AFI redist registrations
Donald Sharp [Wed, 20 May 2015 01:03:45 +0000 (18:03 -0700)]
Per AFI redist registrations

The problem is that zclient->redist[ZEBRA_ROUTE_MAX] used for storing a
client’s redist state, has no address-family qualification. This means
a client can only store its interest in a protocol (connected, static etc.),
but cant choose IPv4 or ipv6 with that. This hindered implementation on
client sides to manage redistribution of ipv4 and ipv6 both.

BGP's redistribution of protocols like connected/static is one such place.

One fix could be to overload this and flap the redist connection each time
any new afi is added for redist, but that may have side-effects on the
existing afi redist.

The cleaner way is to modify redist data-structure to also take AFI, and adjust
routines that deal with it, so that a client can register for a protocol
redistribution based on the AFI. BGP already maintains redistribution state
based on afi and protocol (bgp->redist[AFI_MAX][ZEBRA_ROUTE_MAX]). This patch
takes care of filling up the gap in zclient/zserv redistribution state to
also use AFI qualification.

Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
9 years agoBGP: add addpath RX support
Donald Sharp [Wed, 20 May 2015 01:03:45 +0000 (18:03 -0700)]
BGP: add addpath RX support

9 years agoA valid BGP nexthop is flagged as invalid
Donald Sharp [Wed, 20 May 2015 01:03:44 +0000 (18:03 -0700)]
A valid BGP nexthop is flagged as invalid

9 years agoAdd support for filtering by tag in a route-map when installing routes in the kernel
Donald Sharp [Wed, 20 May 2015 01:03:44 +0000 (18:03 -0700)]
Add support for filtering by tag in a route-map when installing routes in the kernel

9 years agoDuring best path selection, if one of the candidates is a stale entry, do not
Donald Sharp [Wed, 20 May 2015 01:03:44 +0000 (18:03 -0700)]
During best path selection, if one of the candidates is a stale entry, do not
perform the neighbor address comparison as that information is invalid for
the stale entry. Attempting to perform the comparison results in a bgpd
exception.

9 years agoISSUE:
Donald Sharp [Wed, 20 May 2015 01:03:43 +0000 (18:03 -0700)]
ISSUE:
LSAcks (for directed acks) are being sent to neighbor's unicast address.

RFC 2328 says:

"The IP destination address for the packet is selected as
 follows.  On physical point-to-point networks, the IP
 destination is always set to the address AllSPFRouters"

Fix is to unconditionally set the destination address for LSAcks over
point-to-point links as AllSPFRouters. Quagga OSPF already has similar
change for OSPF DBD, LSUpdate and LSrequest packets.

Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
9 years agoIf a BGP path has an unreachable nexthop display that path as invalid
Donald Sharp [Wed, 20 May 2015 01:03:43 +0000 (18:03 -0700)]
If a BGP path has an unreachable nexthop display that path as invalid

9 years agoCorrect a few fuzz failures in BGP
Donald Sharp [Wed, 20 May 2015 01:03:43 +0000 (18:03 -0700)]
Correct a few fuzz failures in BGP

9 years agozebra-redistribute-table.patch
Donald Sharp [Wed, 20 May 2015 01:03:42 +0000 (18:03 -0700)]
zebra-redistribute-table.patch

Zebra: Redistribute routes from non-main kernel table to main.

This can be the basis for many interesting features such as variations
of redistribute ARP, using zebra as the RIB in the presence of multiple
routing protocol stacks etc. The code only supports IPv4 for now, but
the infrastructure is in place for IPv6.

Usage:
There is a new route type introduced by this model: TABLE. Routes
imported from alternate kernel tables will have their protocol type set to
TABLE.

Routes from alternate kernel tables MUST be first imported into the main
table via "ip import-table <table id>". They can then be redistributed via
a routing protocol via the "redistribute table" command. Each imported table
can an optional administrative distance specified. In Zebra, a route with a
lower distance is chosen over routes with a higher distance. So, distance
is how the user can choose to prioritize routes from a particular table over
routes from other tables or routes learnt another way in zebra.

Route maps for imported tables are specified via "ip protocol" command in
zebra. Route maps for redistributed routes within a routing protocol are
subject to the route map options supported by the protocol. The
"match source-protocol" option in route maps can match against "table"
to filter routes learnt from alternate kernel routing tables.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
9 years agoMulti-Instance OSPF Summary
Donald Sharp [Wed, 20 May 2015 01:03:42 +0000 (18:03 -0700)]
Multi-Instance OSPF  Summary
——————————————-------------

- etc/init.d/quagga is modified to support creating separate ospf daemon
  process for each instance. Each individual instance is monitored by
  watchquagga just like any protocol daemons.(requires initd-mi.patch).

- Vtysh is modified to able to connect to multiple daemons of the same
  protocol (supported for OSPF only for now).

- ospfd is modified to remember the Instance-ID that its invoked with. For
  the entire life of the process it caters to any command request that
  matches that instance-ID (unless its a non instance specific command).
  Routes/messages to zebra are tagged with instance-ID.

- zebra route/redistribute mechanisms are modified to work with
  [protocol type + instance-id]

- bgpd now has ability to have multiple instance specific redistribution
  for a protocol (OSPF only supported/tested for now).

- zlog ability to display instance-id besides the protocol/daemon name.

- Changes in other daemons are to because of the needed integration with
  some of the modified APIs/routines. (Didn’t prefer replicating too many
  separate instance specific APIs.)

- config/show/debug commands are modified to take instance-id argument
  as appropriate.

Guidelines to start using multi-instance ospf
---------------------------------------------

The patch is backward compatible, i.e for any previous way of single ospf
deamon(router ospf <cr>) will continue to work as is, including all the
show commands etc.

To enable multiple instances, do the following:

     1. service quagga stop
     2. Modify /etc/quagga/daemons to add instance-ids of each desired
        instance in the following format:
        ospfd=“yes"
        ospfd_instances="1,2,3"
assuming you want to enable 3 instances with those instance ids.
     3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf
        and ospfd-3.conf.
     4. service quagga start/restart
     5. Verify that the deamons are started as expected. You should see
        ospfd started with -n <instance-id> option.
      ps –ef | grep quagga
      With that /var/run/quagga/ should have ospfd-<instance-id>.pid and
ospfd-<instance-id>/vty to each instance.
     6. vtysh to work with instances as you would with any other deamons.
     7. Overall most quagga semantics are the same working with the instance
      deamon, like it is for any other daemon.

NOTE:
     To safeguard against errors leading to too many processes getting invoked,
     a hard limit on number of instance-ids is in place, currently its 5.
     Allowed instance-id range is <1-65535>
     Once daemons are up, show running from vtysh should show the instance-id
     of  each daemon as 'router ospf <instance-id>’  (without needing explicit
     configuration)
     Instance-id can not be changed via vtysh, other router ospf configuration
     is allowed as before.

Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
9 years agoinitd: initd-mi.patch
Donald Sharp [Wed, 20 May 2015 01:03:41 +0000 (18:03 -0700)]
initd: initd-mi.patch

Support Multi-Instance protocol daemons initd

OSPFd is the first of the multi-instance daemons. This patch allows the
starting, stopping, restarting and monitoring of multiple instances of
the same protocol daemon.

Multiple instances are specified in the daemons file using a new variable:
ospfd_instances="1,2"

Absence of this variable means ospfd will start in legacy, single instance
mode. The original "ospfd=yes" line is still required.

Daemons are started with the "-n <instance>" option. Each daemon is named
"<daemon>-<instance>", for example "ospfd-1", "ospfd-2" etc. Similarly,
pid files are ospfd-1.pid and vty files are named ospfd-1.vty.

We're also introducing a new file, /etc/default/quagga to store the
default value for the maximum instances associated with a daemon.

watchquagga and others are unmodified and everything else just works once
this code is in place.

The code has been enhanced to support restarting watchquagga with only the
updated daemons when an individual daemon is stopped or started. For example,
without this patch, stopping just bgpd would terminate watchquagga even if
ospfd and zebra are still running. Similarly, starting just bgpd when ospfd
and zebra are running wouldn't update watchquagga to include bgpd. Furthermore,
when the daemons file is modified and a daemon is no longer deemed necessary
and quagga restarted, the daemon is not killed. For example, switching
ospfd=yes to ospfd=no and restarting the quagga will leave ospfd daemon
running. This case is also fixed with this patch.

However, adding a new instance to the ospfd_instances file and starting
just that instance will start just that instance and add it to watchquagga.
Similarly, a single instance maybe stopped or restarted.

Caveat emptor: With multi-instance daemons, stopping a single instance and then
starting a different instance will cause all instances to be monitored by
watchquagga i.e. all instances will be restarted, if necessary.

Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com>
9 years agoOSPFv3 should accept long form of "no redistribute"
Donald Sharp [Wed, 20 May 2015 01:03:41 +0000 (18:03 -0700)]
OSPFv3 should accept long form of "no redistribute"

9 years agoospf6d: ospfv3-show-cmds-instance-check-fix.patch
Donald Sharp [Wed, 20 May 2015 01:03:41 +0000 (18:03 -0700)]
ospf6d: ospfv3-show-cmds-instance-check-fix.patch

SYMPTOM:

If some of the ospfv3 commands like 'show ipv6 ospf6 route' are executed
with ospf6d daemon running but before having any ospfv3 configuration, then
ospf6d crash is seen.

ISSUE:

There are a few show commands, which are (unlike others) not checking if
ospf6 instance is initialized already.

FIX:

Add the missing checks, by using OSPF6_CMD_CHECK_RUNNING() in the commands
where its needed and not yet used.

Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Pradosh Mohapatra <pmohapat@cumulusnetworks.com>
             Dinesh Dutt <ddutt@cumulusnetworks.com>

9 years agoSupport for 'clear ipv6 ospf6 interface [ifname]
Donald Sharp [Wed, 20 May 2015 01:03:40 +0000 (18:03 -0700)]
Support for 'clear ipv6 ospf6 interface [ifname]

9 years agoThis is a fix to make sure router-LSA is updated when neighbor's interface ID change
Donald Sharp [Wed, 20 May 2015 01:03:40 +0000 (18:03 -0700)]
This is a fix to make sure router-LSA is updated when neighbor's interface ID change
is received in hello packet.

9 years agoospf6d: ospfv3-setsocket-retry.patch
Donald Sharp [Wed, 20 May 2015 01:03:40 +0000 (18:03 -0700)]
ospf6d: ospfv3-setsocket-retry.patch

SYMPTOM:

With quagga running on Linux, 'ifdown <if-name>' followed by 'ifup <ifname>
can cause OSPFv3 to not receive Hello packets on the interface.

ISSUE:

Operating System's interface IPv6 readiness may not be guaranteed at the
time of interface-up event. Thats because the ipv6 components in an OS may
also be listening to the same interface-up event that (in this case) is
relayed to OSPFv3.

In this failure case, setsockopt with option IPV6_JOIN_GROUP on the interface
returned EINVAL.

Error logs -
OSPF6: Zebra Interface state change: swp1 index 3 flags 11043 metric 1 mtu 1500
OSPF6: Interface Event swp1: [InterfaceUp]
OSPF6: Network: setsockopt (20) on ifindex 3 failed: Invalid argument

FIX:

To take care of this possible race condition, any address-family related
setting should be retried. Given it's a rare condition and window of this
race should be short, the patch adds a limited retry mechanism for the
IPV6 membership setting on the socket.

Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
             Satish Ashok <sashok@cumulusnetworks.com>

9 years agoospf6d: ospfv3-stub-area-support.patch
Donald Sharp [Wed, 20 May 2015 01:03:40 +0000 (18:03 -0700)]
ospf6d: ospfv3-stub-area-support.patch

Support stubby and totally stubby areas in OSPFv3

Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com>
Reviewed-by: Pradosh Mohapatra <pmohapat at cumulusnetworks.com>
9 years agoospf6d: ospfv3-abr-ecmp-support.patch
Donald Sharp [Wed, 20 May 2015 01:03:39 +0000 (18:03 -0700)]
ospf6d: ospfv3-abr-ecmp-support.patch

OSPFv3: Add ABR support and make ECMP > 4.

Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com>
Signed-off-by: Pradosh Mohapatra <pmohapat at cumulusnetworks.com>
9 years agoIncrease SO_SNDBUF and SO_RCVBUF to 8MB to avoid drops in large networks.
Donald Sharp [Wed, 20 May 2015 01:03:39 +0000 (18:03 -0700)]
Increase SO_SNDBUF and SO_RCVBUF to 8MB to avoid drops in large networks.

9 years agoBGP: back to back route refreshes can set BGP_INFO_ATTR_CHANGED on the first route...
Donald Sharp [Wed, 20 May 2015 01:03:38 +0000 (18:03 -0700)]
BGP: back to back route refreshes can set BGP_INFO_ATTR_CHANGED on the first route refresh but then clear it on the second

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
9 years agoImplement BGP as-override feature
Donald Sharp [Wed, 20 May 2015 01:03:14 +0000 (18:03 -0700)]
Implement BGP as-override feature

9 years agoper-interface ospf enable and area set command.
Donald Sharp [Wed, 20 May 2015 00:58:14 +0000 (17:58 -0700)]
per-interface ospf enable and area set command.

9 years agoUnnumbered interface support.
Donald Sharp [Wed, 20 May 2015 00:58:13 +0000 (17:58 -0700)]
Unnumbered interface support.

9 years agoonlink commit from Quagga-RE branch
Donald Sharp [Wed, 20 May 2015 00:58:13 +0000 (17:58 -0700)]
onlink commit from Quagga-RE branch

9 years agoSupport for 'clear ip ospf interface [IFNAME]'
Donald Sharp [Wed, 20 May 2015 00:58:13 +0000 (17:58 -0700)]
Support for 'clear ip ospf interface [IFNAME]'

9 years agoOverhual BGP debugs
Donald Sharp [Wed, 20 May 2015 00:58:12 +0000 (17:58 -0700)]
Overhual BGP debugs

Summary of changes
- added an option to enable keepalive debugs for a specific peer
- added an option to enable inbound and/or outbound updates debugs for a specific peer
- added an option to enable update debugs for a specific prefix
- added an option to enable zebra debugs for a specific prefix
- combined "deb bgp", "deb bgp events" and "deb bgp fsm" into "deb bgp neighbor-events". "deb bgp neighbor-events" can be enabled for a specific peer.
- merged "deb bgp filters" into "deb bgp update"
- moved the per-peer logging to one central log file. We now have the ability to filter all verbose debugs on a per-peer and per-prefix basis so we no longer need to keep log files per-peer. This simplifies troubleshooting by keeping all BGP logs in one location.  The use
r can then grep for the peer IP they are interested in if they wish to see the logs for a specific peer.
- Changed "show debugging" in isis to "show debugging isis" to be consistent with all other protocols.  This was very confusing for the user because they would type "show debug" and expect to see a list of debugs enabled across all protocols.
- Removed "undebug" from the parser for BGP.  Again this was to be consisten with all other protocols.
- Removed the "all" keyword from the BGP debug parser.  The user can now do "no debug bgp" to disable all BGP debugs, before you had to type "no deb all bgp" which was confusing.

The new parse tree for BGP debugging is:

deb bgp as4
deb bgp as4 segment
deb bgp keepalives [A.B.C.D|WORD|X:X::X:X]
deb bgp neighbor-events [A.B.C.D|WORD|X:X::X:X]
deb bgp nht
deb bgp updates [in|out] [A.B.C.D|WORD|X:X::X:X]
deb bgp updates prefix [A.B.C.D/M|X:X::X:X/M]
deb bgp zebra
deb bgp zebra prefix [A.B.C.D/M|X:X::X:X/M]

9 years agoChanges to improve BGP convergence time:
Donald Sharp [Wed, 20 May 2015 00:58:12 +0000 (17:58 -0700)]
Changes to improve BGP convergence time:

- Schedule write thread for advertisements and withdraws only if corresponding
  FIFOs are growing and/or upon work_queue getting fully processed.
- Set non-default yield time for the main work_queue, as the default value
  of 10ms results in yielding after processing very few nodes.
- Remove unnecessary scheduling of write thread when update packet is formed.
- If MRAI is 0, don't start a timer unnecessarily, directly schedule write
  thread.
- Some debugs.

9 years agoClarify the different permutations of soft clearing a peer
Donald Sharp [Wed, 20 May 2015 00:58:11 +0000 (17:58 -0700)]
Clarify the different permutations of soft clearing a peer

9 years ago"set metric -10" is not accepted by the parser on 64-bit x86 platforms
Donald Sharp [Wed, 20 May 2015 00:58:11 +0000 (17:58 -0700)]
"set metric -10" is not accepted by the parser on 64-bit x86 platforms

9 years agoAdd [bestpath|multipath] option to 'show ip bgp x.x.x.x'
Donald Sharp [Wed, 20 May 2015 00:58:11 +0000 (17:58 -0700)]
Add [bestpath|multipath] option to 'show ip bgp x.x.x.x'

9 years agoBGP crashes if attributes alone consume > 4096 bytes
Donald Sharp [Wed, 20 May 2015 00:58:10 +0000 (17:58 -0700)]
BGP crashes if attributes alone consume > 4096 bytes

9 years agoAdd clear command to force a bestpath recalculation and re-advertisement of a prefix
Donald Sharp [Wed, 20 May 2015 00:58:10 +0000 (17:58 -0700)]
Add clear command to force a bestpath recalculation and re-advertisement of a prefix

9 years agoSome small enhancements to thread and workqueue libraries in zebra:
Donald Sharp [Wed, 20 May 2015 00:58:10 +0000 (17:58 -0700)]
Some small enhancements to thread and workqueue libraries in zebra:

- Allow work queues to specify the yield duration for corresponding background thread
- Support using specified yield duration in thread yielding
- During work queue processing, if using a single list element with a meta-queue
  (like done in Zebra), do not exit after each element is processed, instead
  update the next-node upon a WQ_REQUEUE so that the WQ processing continues
  and is terminated by the yield logic.
- Enhance work queue debug output

9 years agoAdd replace-as option to remove-private-as
Donald Sharp [Wed, 20 May 2015 00:57:34 +0000 (17:57 -0700)]
Add replace-as option to remove-private-as

9 years agoSend CEASE NOTIFICATIONS to all peers on "no router bgp"
Donald Sharp [Wed, 20 May 2015 00:47:26 +0000 (17:47 -0700)]
Send CEASE NOTIFICATIONS to all peers on "no router bgp"

9 years agobgpd-delete-route-on-invalid-nh.patch
Donald Sharp [Wed, 20 May 2015 00:47:25 +0000 (17:47 -0700)]
bgpd-delete-route-on-invalid-nh.patch

BGPd: Delete the route from the kernel when a valid NH changes to invalid NH

A route has been announced by a BGP peer with a valid NH and has been
populated into the kernel. Now, if the NH announced changes (say via routemap)
to an invalid NH, the route is marked as inactive/inaccessible inside Quagga,
but is not deleted from the kernel. This patch fixes that issue.

The problem is caused by BGP losing the old valid NH and using the new, invalid
NH to delete the now-inaccessible route. However, the kernel/zebra has the
route using the old NH and so they reject the delete. Fix involves not sending
the invalid NH when its the only NH. Things worked fine if the route had BGP
multipath.

9 years agozebra-set-src-routemap.patch
Donald Sharp [Wed, 20 May 2015 00:47:24 +0000 (17:47 -0700)]
zebra-set-src-routemap.patch

Honor setting source via route map and pushing that to the kernel.

With recursive routes, the ability to set the source IP address of a route
via a routemap has been broken. This patch fixes that.

To allow route map to set a source and then to unapply the route map and
have the source be taken out, I've introduced a new field in the nexthop
data structure called rmap_src. This field is zero'd before invoking the
route map apply function.

Today, no protocol daemon specifies the src in its route update to zebra.
If that happens, I didn't want to stomp on it and so have left the src
field intact instead of reusing that for the routemap to play with.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
9 years agoFix aggregation issues found via ANVL
Donald Sharp [Wed, 20 May 2015 00:47:24 +0000 (17:47 -0700)]
Fix aggregation issues found via ANVL

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
9 years ago(no commit message)
Donald Sharp [Wed, 20 May 2015 00:47:24 +0000 (17:47 -0700)]

9 years agoBlock martian address configuration on an interface and also block from
Donald Sharp [Wed, 20 May 2015 00:47:23 +0000 (17:47 -0700)]
Block martian address configuration on an interface and also block from
getting installed into the zebra tables.

9 years agoiBGP multipath is broken if 'bgp deterministic-med' is enabled
Donald Sharp [Wed, 20 May 2015 00:47:23 +0000 (17:47 -0700)]
iBGP multipath is broken if 'bgp deterministic-med' is enabled

9 years agoThis patch adds support for a new BFD session down message from zebra to
Donald Sharp [Wed, 20 May 2015 00:47:23 +0000 (17:47 -0700)]
This patch adds support for a new BFD session down message from zebra to

protocols. BGP and OSPF are integrated to respond this BFD session down message
originated in Zebra via ptmd.

BGP and OSPF now have a bfd command, which tells OSPF/BGP to respond to the
BFD session down message.

OSPF:

interface <>
 ip ospf bfd

BGP:

router bgp <>
  neighbor <> bfd

Please note that these commands don't enable BFD as a protocol. BFD configuration
and paramter tuning are via BFD applicable UI.

Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
9 years agozebra: zebra-client-info-detail.patch
Donald Sharp [Wed, 20 May 2015 00:47:22 +0000 (17:47 -0700)]
zebra: zebra-client-info-detail.patch

Zebra: Gather and display detailed info about clients of Zebra

The display of zebra client info is rather paltry: just the name and the FD.
For troubleshooting and general helpfulness, its useful to gather more info
about each client and display that. This patch does just that.

9 years agozebra: zebra-static-route-nht.patch
Donald Sharp [Wed, 20 May 2015 00:47:22 +0000 (17:47 -0700)]
zebra: zebra-static-route-nht.patch

Use NHT to support static routes with NH derived from protocols.

9 years ago'set metric -12' is broken in the parser
Donald Sharp [Wed, 20 May 2015 00:47:22 +0000 (17:47 -0700)]
'set metric -12' is broken in the parser

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
9 years agoatomic-aggregate is lost when we aggregate another aggregate that has atomic-aggregate
Donald Sharp [Wed, 20 May 2015 00:47:21 +0000 (17:47 -0700)]
atomic-aggregate is lost when we aggregate another aggregate that has atomic-aggregate

9 years agoBGP OutQ counters sometimes display very high values
Donald Sharp [Wed, 20 May 2015 00:47:21 +0000 (17:47 -0700)]
BGP OutQ counters sometimes display very high values

9 years agobgpd-nht-connected-route.patch
Donald Sharp [Wed, 20 May 2015 00:47:21 +0000 (17:47 -0700)]
bgpd-nht-connected-route.patch

BGP: Use next hop tracking for connected routes too

And cleanup obsolete code in bgp_scan and bgp_import.

9 years agozebra: zebra-nht-routemap.patch
Donald Sharp [Wed, 20 May 2015 00:47:20 +0000 (17:47 -0700)]
zebra: zebra-nht-routemap.patch
Zebra: Add route-map support for Next Hop Tracking

It is sometimes useful to restrict the resolution of recursive routes
to only specific via's. For example, in some configurations resolving
a route through a default route is not acceptable.

This patch adds a new route-map attach point, to zebra's next-hop-tracking
server. Whenever NHT is considering sending notification of a route
resolution, it applies a specified route-map and only if it passes, is the
NHT reachable message sent to the appropriate client protocol (BGP, OSPF etc.).
If the route-map filters the resolution, then a withdraw is sent to the
client protocol.

The route-map is sent the ip address of the route via which the resolution is
happening as well as the valid NHs associated with that route.

We also add support for matching on IP addr prefix len and source protocol
to ensure that resolution happens only via a very specific route.

9 years agoMake the private AS number check 4 byte compatible.
Donald Sharp [Wed, 20 May 2015 00:47:20 +0000 (17:47 -0700)]
Make the private AS number check 4 byte compatible.

Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
9 years agoAdd support for route tags
Donald Sharp [Wed, 20 May 2015 00:46:33 +0000 (17:46 -0700)]
Add support for route tags

Credit
------
A huge amount of credit for this patch goes to Piotr Chytla for
their 'route tags support' patch that was submitted to quagga-dev
in June 2007.

Documentation
-------------
All ipv4 and ipv6 static route commands now have a "tag" option
which allows the user to set a tag between 1 and 65535.

quagga(config)# ip route 1.1.1.1/32 10.1.1.1 tag ?
  <1-65535>  Tag value
quagga(config)# ip route 1.1.1.1/32 10.1.1.1 tag 40
quagga(config)#

quagga# show ip route 1.1.1.1/32
Routing entry for 1.1.1.1/32
  Known via "static", distance 1, metric 0, tag 40, best
  * 10.1.1.1, via swp1

quagga#

The route-map parser supports matching on tags and setting tags
!
route-map MATCH_TAG_18 permit 10
 match tag 18
!

!
route-map SET_TAG_22 permit 10
 set tag 22
!

BGP and OSPF support:
- matching on tags when redistribing routes from the RIB into BGP/OSPF.
- setting tags when redistribing routes from the RIB into BGP/OSPF.

BGP also supports setting a tag via a table-map, when installing BGP
routes into the RIB.

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
9 years agobgpd-fix-nexthop-show.patch
Donald Sharp [Wed, 20 May 2015 00:40:47 +0000 (17:40 -0700)]
bgpd-fix-nexthop-show.patch

"show ip bgp nexthop detail" couldn't display multiple NHs due to a bug.
Fix that.

9 years agobgpd: bgpd-route-map-match-interface.patch
Donald Sharp [Wed, 20 May 2015 00:40:47 +0000 (17:40 -0700)]
bgpd: bgpd-route-map-match-interface.patch

BGP: Add match interface support to BGP route-map.

Currently, BGP route maps don't support interface match. This is a problem
for commands such as redistribite connected that cannot exclude routes from
specific interfaces (such as mgmt interfaces).

9 years agoMake "no redistribute" always remove the redistribute statement
Donald Sharp [Wed, 20 May 2015 00:40:46 +0000 (17:40 -0700)]
Make "no redistribute" always remove the redistribute statement

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
9 years agoFix "no set metric" for ospf6 and RIP
Donald Sharp [Wed, 20 May 2015 00:40:46 +0000 (17:40 -0700)]
Fix "no set metric" for ospf6 and RIP

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
9 years agoSummary: Test effect of route-map on received/advertised routes
Donald Sharp [Wed, 20 May 2015 00:40:45 +0000 (17:40 -0700)]
Summary: Test effect of route-map on received/advertised routes

This patch adds the ability to see the effect of applying a route-map on
the routes received or advertised from or to a neighbor. This effect can
be seen without actually affecting the current state. If the result seen
is what is desired, then the user can actually apply the route-map.
Currently, the application acts on route-map in or out and on unsuppress
maps.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
9 years agobgpd: bgpd-event-driven-route-map-updates.patch
Donald Sharp [Wed, 20 May 2015 00:40:45 +0000 (17:40 -0700)]
bgpd: bgpd-event-driven-route-map-updates.patch

BGP: Reprocess the trigger points when an attached route map changes

Currently, modifications to route maps do not affect already processed
routes; they only affect new route updates. This patch addresses this
limitation.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
9 years agoptm-integration.patch
Donald Sharp [Wed, 20 May 2015 00:40:44 +0000 (17:40 -0700)]
ptm-integration.patch

Integrates Prescriptive Topology Module(ptm) into quagga.

If this module is enabled, link ups are notified only after the link is verified
as being connected to the neighbor specified. The neighbor specification and
checking is done by the ptm daemon.

9 years agoiquagga-faster-compile.patch
Donald Sharp [Wed, 20 May 2015 00:40:43 +0000 (17:40 -0700)]
iquagga-faster-compile.patch

Avoid cleaning up the source tree and running reconf every time. Allows
recompilation of only those files that have been modified since last
run. Relies on the existence of config.status file to decide if we've
run the first time or subsequent times.

9 years agoDo not allow a program outside Quagga to delete a Quagga route from the kernel.
Donald Sharp [Wed, 20 May 2015 00:40:43 +0000 (17:40 -0700)]
Do not allow a program outside Quagga to delete a Quagga route from the kernel.
To delete a Quagga route, do it inside Quagga.

9 years agobgpd-maxmed-administrative-onstartup.patch
Donald Sharp [Wed, 20 May 2015 00:40:42 +0000 (17:40 -0700)]
bgpd-maxmed-administrative-onstartup.patch

COMMAND:

Possible forms of the command configuration:

[no] bgp max-med administrative
[no] bgp max-med administrative <max-med-value>
[no] bgp max-med on-startup <period>
[no] bgp max-med on-startup <period> <max-med-value>

DESCRIPTION:

'administrative' takes effect from the time of the config until the config is
removed.

'on-startup' is effective only at the startup time for the given '<period>'
after the first peer is established.

'<max-med-value>' is used as the MED value to be sent out when the max-med
is effective. Default max-med value is 4294967294.

NOTE:
When max-med is active, MED is changed only in the outgoing attributes to the
peers, it doesn't modify any MED specific state of the attributes in BGP on
the local node.

Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
9 years agoReduce the amount of time it takes to bring up a large number of peers
Donald Sharp [Wed, 20 May 2015 00:40:42 +0000 (17:40 -0700)]
Reduce the amount of time it takes to bring up a large number of peers

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
9 years agobgpd-scale-update-delay-packing.patch
Donald Sharp [Wed, 20 May 2015 00:40:42 +0000 (17:40 -0700)]
bgpd-scale-update-delay-packing.patch

ISSUE:
During startup, BGP update prefix packing wasnt optimal and route installation
was found to be spread over.

SOLUTION:
With this patch, update-delay post processing is serialized to achieve:
 a. better peer update packing
    (which helps in reducing total number of BGP update packets)
 b. installation of the resulting routes in zebra as close to each others
    as possible.
    (which can help zebra batch its processing and updates to Kernel better)