Problem reported that in certain configs, when a router is initially
booted and the link is bounced, we can end up with a bogus static route
in the table. This was due to the assumption in zebra_rnh that a static
route would not be recursively resolved through another static route with
a different next-hop. This fix changes this assumption. Tested manually
and bgp-min, ospf-min, and vrf-min run with no new failures.
Ticket: CM-13328 Signed-off-by: Don Slice Reviewed-by: CCR-5338
Donald Sharp [Wed, 9 Nov 2016 15:22:22 +0000 (10:22 -0500)]
watchquagga: Signal when we are actually up and running
When Quagga is starting up, it is returning immediately.
This is leaving us in a state where systemd believes
Quagga is up and running, while the sytem might actually
not have restarted the code yet.
Modify the code so that when watchquagga starts up
it doesn't start communicating with systemd until
such time that it detects that all daemons are
running.
Additionally modify watchquagga to touch a
file in /var/run/quagga/ that the /usr/lib/quagga/quagga
script looks for for 10 seconds. If it finds this
Quagga started file then we know watchquagga
has successfully communicated with all daemons.
If after 10 seconds we haven't communicated
with Quagga, continue on for the start and let the
normal start failure code work.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Don Slice [Tue, 18 Oct 2016 17:18:49 +0000 (10:18 -0700)]
zebra: Move netlink error message under a debug
In some circumstances, the quagga log is being filled with repetitive
error messages reporting "network is down" with RTM_NEWROUTE. Moved this
particular scenario under "debug zebra kernel" instead of making it an
unprotected error message. Manually tested using the same script with and
without the fix to verify the message is suppressed.
Ticket: CM-11173 Signed-off-by: Don Slice Reviewed-by: Donald Sharp
Don Slice [Tue, 11 Oct 2016 15:08:37 +0000 (11:08 -0400)]
bgpd: protect "could not get instance" error message with debug
If bgp gets inbound connect messages on an interface associated with
a vrf, but the vrf is not defined yet in bgp, the log is filled with
continual error messages. This change moves that error message to a
debug under "debug bgp neighbor-events". Manual testing results
applied to the ticket.
Ticket: CM-10394 Signed-off-by: Don Slice Reviewed-by: Donald Sharp
Donald Sharp [Wed, 5 Oct 2016 20:11:12 +0000 (20:11 +0000)]
bgpd: Reduce json memory usage.
When running 'show bgp ipv4 uni summ' (or any variation thereof)
If you have a large # of routes, the json package starts taking
up a tremendous amount of memory and processing power.
Modify the code to output the json as we go instead of gathering
it all up and outputting at the end.
Ticket: CM-13060 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Don Slice [Wed, 5 Oct 2016 19:54:48 +0000 (12:54 -0700)]
zebra: add support for ipv6 static to null0
Added the capability of defining an ipv6 static route to null0,
similar to the support previously in ipv4 only.
Ticket: CM-5794 Signed-off-by: Don Slice
Reviewed By: CCR-5223
Testing Done: Manual tested added to the ticket and bgp and ospf smoke
successfully completed
Don Slice [Thu, 6 Oct 2016 17:50:36 +0000 (13:50 -0400)]
ospfd: Display all ospf peers with show ip ospf neighbor detail all
Problem reported that no peers are displayed when the command "show
ip ospf neighbor detail all" is entered. Determined that the problem
was actually that the function only displayed NBMA peers, and since
we rarely (if ever) define NBMA peers, nothing is normally displayed.
Changed the code to display both NBMA and non-NBMA peers, in both the
up and down state. Manual testing attached to the jira ticket.
Ticket: CM-5878 Signed-off-by: Don Slice Reviewed-by: Daniel Walton
Daniel Walton [Tue, 27 Sep 2016 15:56:36 +0000 (15:56 +0000)]
tools: quagga-reload should raise Exception instead of exiting
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
NCLU imports quagga-reload.py and uses its Config class to parse
Quagga.conf. The Config class will call 'vtysh -m -f Quagga.conf" and
if that exited with an error Config would call sys.exit(1) which in my
cases causes the NCLU daemon to exit which is bad. The fix is to have
the Config class raise an exception instead of exiting, then NCLU can
catch the exception, log it and move on.
Don Slice [Fri, 16 Sep 2016 16:20:03 +0000 (09:20 -0700)]
bgpd: resolve memory leaks in "show ip bgp neighbor json"
Found several leaks in bgp_show_peer and bgp_show_peer_afi where
json objects are created and then not attached to the parent, causing
them to be leaked. If not attaching them, freeing the created objects.
Manual testing performed successfully. Fix tested succesfully by the
submitter and bgp-smoke completed with same failures as base.
Ticket: CM-12846 Signed-off-by: Don Slice Reviewed-by: CCR-5181
Don Slice [Mon, 12 Sep 2016 13:32:11 +0000 (06:32 -0700)]
lib: apply mask to prefix in prefix-list
A crash occurred if a prefix was defined in a prefix-list that
contained bits in the prefix but a /0 mask. Resolving that crash
and improving usability by applying the mask to the supplied prefix
and notifying the user if the prefix was modified.
Ticket: CM-12744 Signed-off-by: Don Slice
Reviewed_By:
Testing Done: Manual testing attached to the ticket, bgp-min, bgp-smoke
ospf-min, and ospf-smoke all completed before commit
Don Slice [Fri, 9 Sep 2016 13:35:47 +0000 (06:35 -0700)]
bgpd: Display interface next-hop for "show ip bgp" with unnumbered
Found that the logic had been changed to determine whether the next-hop
is a v4 or v6 address. This caused an unnumbered interface to be seen
as ipv4 instead of ipv6 so the swp port was not correctly displayed.
Changed it back. Manual testing attaced to the ticket and bgp-min will
be run before committing.
Ticket: CM-12759 Signed-off-by: Don Slice Reviewed-by: CCR-5166
bgpd: Process directly connected IBGP peers upon interface down
When we have a single-hop BFD session for any peering, it really means
that the peering is directly connected (maybe over a L2 network), whether
it is IBGP or EBGP. In such a case, upon link down, immediately process
IBGP peers too (and bring them down), not just EBGP peers.
This change eliminates some peculiar state transitions in specific IBGP
topologies, thus getting rid of the problem of nexthops remaining inactive
in the zebra RIB.
bgpd: Fix route install upon multipath nexthop change
In multipath selection, there can be a scenario where the set of route
entries selected as multipath can be the same (i.e., from the same peers)
but one or more of these may have a change to the BGP next hop. In this
case, the route needs to be installed again in zebra even if the best
route entry selected has not changed, otherwise the zebra RIB may have
a different set of next hops (and first hops) than what the routing
protocol selected.
This patch handles this scenario by re-installing the route if any BGP
attribute has changed for any of the multipaths. Not all BGP attributes
are of relevance to the zebra RIB, but this approach follows existing
logic used in the code (e.g., when BGP attributes for the best route
entry has changed).
bgpd: Fix route install upon non-best nexthop change
After BGP path selection, even if the best route entry selected has not
changed, ensure that the route is installed again in zebra if any non-best
but multipath route entry has a nexthop resolution change.
In the absence of this fix, if a non-best multipath route entry had a
nexthop resolution change (such as being resolved over two first hops instead
of one), the route would get reinstalled into zebra only in some situations
(i.e., when the best route entry had its IGP change flag set). If the route
does not get reinstalled by BGP, the corresponding route in the zebra RIB
would not have all the first hops.
Daniel Walton [Wed, 31 Aug 2016 12:31:47 +0000 (12:31 +0000)]
Quagga won't advertise 0.0.0.0/0 with network statement
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-12561
(cherry picked from commit 337299a936d9db8951825dcbf3acc4bd3b89ac32)
Daniel Walton [Mon, 29 Aug 2016 19:59:53 +0000 (19:59 +0000)]
json support for "show ip route" for "show ipv6 route"
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-12633
(cherry picked from commit 18a4ded2a72cc5613f54845dd29c1ee7d05bbf04)
Daniel Walton [Wed, 31 Aug 2016 12:58:46 +0000 (12:58 +0000)]
quagga-reload.py should be importable
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Ticket: CM-12686
(cherry picked from commit a782e613dd44a4447e4a9ef08cfe014e09da2b2f)
David Lamparter [Wed, 31 Aug 2016 11:31:16 +0000 (13:31 +0200)]
zebra: stack overrun in IPv6 RA receive code (CVE ##TBA##)
The IPv6 RA code also receives ICMPv6 RS and RA messages.
Unfortunately, by bad coding practice, the buffer size specified on
receiving such messages mixed up 2 constants that in fact have different
values.
The code itself has:
#define RTADV_MSG_SIZE 4096
While BUFSIZ is system-dependent, in my case (x86_64 glibc):
/usr/include/_G_config.h:#define _G_BUFSIZ 8192
/usr/include/libio.h:#define _IO_BUFSIZ _G_BUFSIZ
/usr/include/stdio.h:# define BUFSIZ _IO_BUFSIZ
As the latter is passed to the kernel on recvmsg(), it's possible to
overwrite 4kB of stack -- with ICMPv6 packets that can be globally sent
to any of the system's addresses (using fragmentation to get to 8k).
(The socket has filters installed limiting this to RS and RA packets,
but does not have a filter for source address or TTL.)
Issue discovered by trying to test other stuff, which randomly caused
the stack to be smaller than 8kB in that code location, which then
causes the kernel to report EFAULT (Bad address).
Ticket: CM-12687 Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
root [Tue, 30 Aug 2016 12:59:08 +0000 (08:59 -0400)]
bgpd: Add fix for multiple set commands with prefer-global
In further testing, found that if there were multiple set commands in
the route-map with one being prefer-global, the removal of the prefer-global
was not recognized and reacted to correctly. This small addition includes
that support
Ticket: CM-11480 Signed-off-by: Don Slice
Reviewed By: Donald Sharp
Testing Done: Manual testing, bgp-min and bgp-smoke completed
David Lamparter [Fri, 12 Aug 2016 23:20:20 +0000 (01:20 +0200)]
isisd: fix is_type_set
Code's "is_type" is "circuit-type" in CLI, "circuit_type" is "network"
(type) in CLI, and the function to change is_type is
isis_event_circuit_type_change()... *headdesk*
Reported-by: Martin Winter <mwinter@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Thu, 11 Aug 2016 15:02:50 +0000 (17:02 +0200)]
isisd: fix isis_circuit_af_set() on fresh circuit
A newly-created circuit will be in enabled state but have neither IPv4
nor IPv6 configured. The logic in isis_circuit_af_set assumed that
"enabled" is equivalent to "ip || ipv6".
This is the only place where this distinction is currently relevant, as
the CLI won't allow enabling an interface without enabling either IPv4
or IPv6; and it will also disable a circuit when both are deconfigured.
Reported-by: Martin Winter <mwinter@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Thu, 11 Aug 2016 14:59:08 +0000 (16:59 +0200)]
isisd: fix isis_circuit_create()
Between the awkwardly managed CSM and the tacked-on IPv6 support, the
simplified logic to setup a circuit wasn't quite right.
Note that the API essentially allows creating a circuit without enabling
either IPv4 or IPv6. This wasn't possible before and probably breaks
isisd in 'interesting' ways. The CLI won't do this, so it's only an
issue when adding on other configuration mechanisms.
Reported-by: Martin Winter <mwinter@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
vivek [Thu, 18 Aug 2016 22:02:49 +0000 (15:02 -0700)]
bgpd: Upon interface up (update) only kick-off non-Established peers
Any interface flags/parameter change (e.g., MTU, PROMISC flag change) is
notified by zebra to clients as an "up" event. BGP literally treats this
as the interface coming up and kicks all neighbors on that interface (i.e.,
directly connected peers). When doing so for IPv4 peers on the interface
(numbered or unnumbered /30-/31) or IPv6 numbered peers, peers that may
already be Established are also flapped; when doing so for IPv6 unnumbered
peers (classic 'neighbor swpX interface' scenario with no configured IP
address on interface), only peers not in Established state are processed.
This patch fixes the code to ensure that in all cases, only non-Established
peers are kicked.
Donald Sharp [Mon, 15 Aug 2016 16:04:30 +0000 (12:04 -0400)]
zebra: Fix usage of accidental NULL pointer
NS_DEFAULT is #defined to 0, We are passing it
in to a function that is taking 'struct zebra_ns *'
which is translating into a NULL pointer. Which
in some situations will cause a crash.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Daniel Walton <dwalton@cumulusnetworks.com>
Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
The recommended, and in many ways the only supported, model for
the configuration file of quagga is to use a single Quagga.conf
configuration file. However, we weren't shipping with this model,
which led to some confusion amongst users. This patch fixes this
by removing all individual daemon configuration files and replacing
it with the single Quagga.conf file.
Sid Khot [Sat, 13 Aug 2016 00:09:27 +0000 (17:09 -0700)]
bgpd: Reverting fix for CM-5040: BGP and OSPF should accept "router-id use-loopback"
ospfd: Reverting fix for CM-5040: BGP and OSPF should accept "router-id use-loopback"
Donald Sharp [Wed, 3 Aug 2016 14:26:31 +0000 (10:26 -0400)]
lib: Arm build breakage with MAX_INT macro issues
The VTY_GET_INTEGER_RANGE macro is failing on arm
with a warning->error issue where we are passing in
a unsigned MAXINT to this macro and it is complaining
that the comparison of (TMPL) > MAXINT is always going
to be false because of data structure size.
I've changed the tmp variable to a unsigned long long
which alleviates this issue.
Ticket: CM-12187 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Don Slice [Wed, 3 Aug 2016 13:49:09 +0000 (06:49 -0700)]
bgpd: Add command to prefer global ipv6 address
There are cases where customers desire the ability to override the
default behavior of installing ipv6 prefixes with a link-local next-hop
if both a link-local and global ipv6 next-op is present in the bgp table.
This fix provides this ability and will allow the global to be used as the
next-hop. This also retains the ability to manually set the ipv6 next-hop
global value as before, and if so, this manual entry will be used for the
next-hop.
Ticket: CM-11480 Signed-off-by: Don Slice
Reviewed By: CCR-4983
Testing Done: Manual testing results attached to the ticket. bgp-min and
bgp-smoke will be completed before committing.
David Lamparter [Thu, 28 Jul 2016 15:23:32 +0000 (17:23 +0200)]
isisd: drop unused per-type metric values
Expense, Error and Delay metrics never quite made it into the real
world. Either way isisd does nothing useful with them, so let's drop
them from the code. If someone wants to implement them, this patch can
still be reverted.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Thu, 28 Jul 2016 15:23:49 +0000 (17:23 +0200)]
*: get rid of "MTYPE 0"
A few places are using 0 in place of the MTYPE_* argument. The
following rewrite of the alloc tracking won't deal with that, so let's
use MTYPE_TMP instead.
Acked-by: Vincent JARDIN <vincent.jardin@6wind.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
[DL: v2: fix XFREE(0, foo) calls too] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Thu, 28 Jul 2016 15:23:48 +0000 (17:23 +0200)]
pimd: relegate pim_igmp_join.c into a header file
pim_igmp_join.c only exists to make some portability hacks available to
test_igmpv3_join. The function only has 1 call site in each pimd and
the test tool, so it's nicely served as a simple static function in a
header file.
This removes a MTYPE related compiler/linker issue from referencing
lib/if.h in a binary that doesn't link libzebra, as test_igmpv3_join is
now fully independent of lib/.
(Fix by Christian Franke: remove stray leftover ifindex_t)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Thu, 28 Jul 2016 15:23:43 +0000 (17:23 +0200)]
lib: AgentX: use threads instead of eventloop hack
AgentX fd/timeout handling is rather hackishly monkeyed into thread.c.
Replace with code that uses plain thread_* functions.
NB: Net-SNMP's API rivals Quagga's in terms of age and absence of
documentation. netsnmp_check_outstanding_agent_requests() in particular
seems to be unused and is therefore untested.
The most useful documentation on this is actually the blog post Vincent
Bernat wrote when he originally integrated this into lldpd and Quagga:
https://vincent.bernat.im/en/blog/2012-snmp-event-loop.html
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Thu, 28 Jul 2016 15:23:42 +0000 (17:23 +0200)]
lib: add thread_add_timer_tv (struct timeval)
Another zoo extension, this adds a timer scheduling function that takes
a struct timeval argument (which is actually what the wrappers boil down
to, yet it's not exposed...)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Thu, 28 Jul 2016 15:23:41 +0000 (17:23 +0200)]
lib: linklist: add listnode_add_before()
This utility function, to join the zoo that the Quagga linked-list
implementation has accumulated, does an insert-before while returning
the newly allocated node.
It is similar to:
- listnode_add_after(), but
- complementary direction
- returns allocated node
- list_add_node_prev(), but
- supports before == NULL
- returns allocated node
In general, the entire linked-list implementation is in bad shape, and
while it needs a cleanup / rewrite / replacement, this would both cause
significant conflicts and block other cleanups...
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Thu, 28 Jul 2016 15:23:40 +0000 (17:23 +0200)]
lib: remove a whole bunch of unused time stuff
QUAGGA_CLK_REALTIME and QUAGGA_CLK_REALTIME_STABILISED aren't used
anywhere in the code. Remove. The enum is kept to avoid having to
change the calls everywhere.
Same applies to the workaround code for systems that don't have a
monotonic clock. None of the systems Quagga works on fall into that
category; Linux, BSD and Solaris all do clock_gettime, for OSX we have
mach_absolute_time() - that covers everything.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Thu, 28 Jul 2016 15:23:38 +0000 (17:23 +0200)]
ospfd: use random() to pick initial DD seq#
While the idea for this came the other way around - removing
quagga_time() - using random() is actually a better idea here. It's
seeded by time to begin with, but if ospfd restarts several times in a
short timespan it won't run straight into the same sequence number.
(Should also update the random seed to include microseconds so restarts
within a second use a different seq#)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Thu, 28 Jul 2016 15:23:34 +0000 (17:23 +0200)]
bgpd: divorce router-id logic from CLI & zebra
Logic for determining the router-id was spread out over bgp_zebra.c and
bgp_vty.c. Move to bgpd/bgpd.c and have these two call more properly
encapsulated functions.
Significant work by Christian Franke <chris@opensourcerouting.org>.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Thu, 28 Jul 2016 15:23:33 +0000 (17:23 +0200)]
bgpd: minor header/API clean up
Adds "const" on:
- peer_update_source_addr_set()
- peer_description_set()
Adds parameter names on:
- bgp_timers_set()
(really confusing, this one, with 2 unexplained args of same type)
Adds new setter:
- peer_afc_set(), calling peer_activate/peer_deactivate.
(intended for API consumers, matches peer->afc)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Don Slice [Thu, 28 Jul 2016 21:35:48 +0000 (14:35 -0700)]
bgpd: Pass correct bgp-name for clear command
Found that original fix for CM-10113 had a significant flaw, that
by deriving the bgp instance from the vty->index, if a clear ip bgp
command was entered from a vty index other then bgp, a crash occurred.
This fix passes the bgp->name to the clear functions so the correct
instance can be derived. Tested manually in both the CM-10113 case
as well as the problem discovered while testing CM-11480.
Ticket: CM-10113 Signed-off-by: Don Slice
Reviewed-by:
bgpd: Fix for CM-11908 BGP: 'Address-family encap' cli issues
Made fix to handle the "Ambigious command" for address-family vpvn6 and vpnv6 unicast.
Rest of the bug analysis is below:
1. Issues with address-family encap/address-family encapv6/address-family vpnv6/address-family vpnv6 unicast need to be added to the ignore list in the test file tests.l3.quagga_cfg_cli_crawler_test. Sid to fix the "Ambiguous command" for vpnv6 as part of fix for this bug.
2. Neighbor <ipaddr/interface> disable-connected-check/ttl. Options should not be listed for interface. Anitha to file bugs for these. And also remove these commands from the test file tests.l3.quagga_cfg_cli_crawler_test.
Ticket: CM-11908
Reviewed By: CCR-4999
Testing Done: Manual, Ran the tests.l3.quagga_cfg_cli_crawler_test
Don Slice [Tue, 26 Jul 2016 13:44:39 +0000 (06:44 -0700)]
lib: Free memory correctly when braces used in parser
When braces (optional parameters) are used in the quagga parser, there
was a small leak on every iteration. Since this construct is primarily
used in the configuation process rather than show commands, it was not
readily apparent. With the addition of the "show ip bgp {json}" form of
the commands, each time one was run, memory was leaked.
Ticket: CM-11435 Signed-off-by: Don Slice
Reviewed By: Donald Sharp
Testing Done: Manual testing, bgp-min and bgp-smoke successful
bgpd: Fix attribute handling upon redistribution metric change
When the metric for a redistributed route is changed through configuration,
the path attribute for the route/routes need to be "re-created" as the hash
entry would change. In the absence of this, the entry would have the correct
values but when a hash lookup is done at a later time (e.g., when trying to
free the entry), it would fail. This patch addresses the "re-creation"
bgpd: Fix for vtysh -m does not mark "end" of router bgp
There was an exit added at the end of the BGP commands after we pulled the code from upstream. This was causing the reload scripts to fail. Removed this exit.
Make vtysh-integrated-config truly the default and fix quagga reload for this.
Ticket: CM-11910
Reviewed By: sharpd, routing-dev slack
Testing Done: Test with nothing in vtysh.conf, add no, remove it etc.
Even though we force integrated config to be the default, we do this by adding
a line to our default vtysh.conf which has integrated config enabled. When we
stopped printing integrated-config as part of wr mem or show running-config, we
broke quagga reload because it was explicitly looking for integrated config.
Furthermore, merely fixing quagga reload wouldn't work because subsequent saves
would result in config being saved to individual files since vtysh.conf no
longer forced the file to be integrated.
This patch fixes both issues. Makes integrated config the default in the code,
rather than via a shipped default file, and fixes quagga reload to look for
the "no integrated-vtysh-config" to deny attempting a reload.
Don Slice [Wed, 20 Jul 2016 12:02:04 +0000 (08:02 -0400)]
bgpd: Print the correct table in "show ip bgp x.x.x.x"
Prior to this change, bgp always identified the routing table used as
the default in the output of "show ip bgp x.x.x.x". This fix changes
the behavior to use the correct table name.
Ticket: CM-10239 Signed-off-by: Don Slice Reviewed-by: Donald Sharp
ospfd: Ensure correct handling of router-id change
Upon router-id change, one object that needs to be updated is the "nbr_self"
structure that is created to contain information about the local router and
is used during DR election, among other things. In the past, the code used to
just change the router-id field of this structure. This is actually not
sufficient - the neighbor has to be deleted and re-added into the tree. This
was fixed upstream and the fix is now available in our tree, but those changes
don't work well with prior Cumulus changes to defer updating the router-id
in the OSPF instance until other cleanup has happened.
Fixed code to update the "nbr_self" structure correctly while continuing to
defer the router_id update in the OSPF structure.
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-11861
Reviewed By: CCR-4980
Testing Done: Manual, failed test
Don't print empty sections as they clutter the output of show-running
Ticket: CM-11808
Reviewed By: CCR-4971
Testing Done: Usual stuff including doing show running with multiple daemons
Interface and VRF are both sections of the config that could possibly be
empty. This unnecessarily clutters the output of show running. This patch
fixes that by not displaying empty sections of interface, and vrf.
Routemaps have a genuine empty stanza and so we cannot add routemap to this
list. Unfortunately this means a "show running-config ospfd" may have empty
route-maps if the route-maps all correspond to BGP, for example. This
is not a concern for the entire "show running-config".
The trick in fixing this is on the vtysh side rather than on the client side.
The reason for this is that its quite tricky given the number of options to
ensure that a daemon never printed a section header unless there was something
to print. On the vtysh side, however, its easy to check if a section is
empty and not print it.
link-detect is on by default, and has been so since the first release
of Cumulus Linux. So, in the light of not displaying defaults, don't
display link-detect if enabled, only if disabled.
Don't display integrated-vtysh-config as its the default in CL.
Ticket: CM-11832
Reviewed By:
Testing Done: Testing that its not displayed if enabled & only if disabled
In the spirit of not displaying the defaults, we shouldn't display
"service integrated-vtysh-config" as its the default. It also tends to
clutter the output with stuff the user doesn't know or care about. This
patch removes displaying that and only prints it when the option is
disabled.
Don Slice [Mon, 18 Jul 2016 14:32:46 +0000 (10:32 -0400)]
bgpd: Use the correct bgp instance for cli commands issuing clear
Some bgp commands end with doing a bgp_clear_vty, which invalidly
made the assumption that the clear should always be done for the default
instance. This fix derives the correct instance from the vty-index if
one is supplied, and uses the default instance if it is not.
Ticket: CM-10113 Signed-off-by: Don Slice Reviewed-by: Donald Sharp
Simplify BGP unnumbered configuration by eliminating the unessential.
To make BGP configuration as simple as possible, assume the capability
extended-nexthop to be default for interface neighbors. Also allow the
ability to specify remote-as on the same line as neighbor interface to
make BGP unnumbered configuration a single line.
One corner case. This is the first feature for which the default for a
member is different from the default for a peer-group. Since advertising
the capability is only done for interface neighbors, the capability is
not set for the peer-group, but is automatically set for interface
neighbors that belong to that peer-group. So, if you want to disable the
advertisement of this capability for an interface neighbor, you must
do it per each interface neighbor.
The patch is more complicated than it needs to be due to the handling
of quagga reload and appropriate updates to the show running output.
Donald Sharp [Fri, 15 Jul 2016 20:40:01 +0000 (16:40 -0400)]
Merge remote-tracking branch 'origin/cmaster' into cmaster-next
P unnumbered configuration a single line.
One corner case. This is the first feature for which the default for a
member is different from the default for a peer-group. Since advertising
the capability is only done for interface neighbors, the capability is
not set for the peer-group, but is automatically set for interface
neighbors that belong to that peer-group. So, if you want to disable the
advertisement of this capability for an interface neighbor, you must
do it per each interface neighbor.
The patch is more complicated than it needs to be due to the handling
of quagga reload and appropriate updates to the show running output.