Commit Graph

9140 Commits

Author SHA1 Message Date
David Lamparter
25b9cb0cc8 zebra: deduplicate nexthops
There exists situations where it is possible to have duplicate
nexthops passed from a higher level protocol into zebra.

This code notices this duplication of nexthops and marks
the duplicates as DUPLICATE so we don't attempt to install
it into the kernel.

This is important on *BSD as I understand it because passing
duplicate nexthops will cause the route to be rejected.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-12 10:05:07 -04:00
Renato Westphal
0492eea08e zebra: fix administrative distance issues
* Reuse route_distance() on rib_add_multipath() and on rib_add();
* Set the admin distance of LDP and BGP MPLS LSPs.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-09-12 11:02:25 -03:00
Donald Sharp
c710b277cf zebra: Fix up default admin distance for some route types
Set the default admin distance for some route types
more appropriately.  The route_distance function
would return 0 for array items not configured, which
is not the right thing to do.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-09-12 10:59:07 -03:00
Renato Westphal
2a178cdd7c ldpd: fix broken label allocation
Once ldpd allocated label 48 for a given FEC, all subsequent requests
for a new label would return the same value (48). The problem is that
we were left shifting an uint32_t value up to 64 times, losing important
information.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-09-12 09:52:54 -03:00
Donald Sharp
e22ac3eec4 bgpd: Fix bgp display of blackhole nexthops
Allow BGP to tell the user that a particular nexthop
is a blackhole nexthop.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-12 08:33:37 -04:00
Donald Sharp
59693377a9 zebra: Allow recursive nexthop resolution to consider blackholes
When we get a route install for a route that needs to be recursively
resolved allow the blackhole to be considered and used if it is
available.

This allows bgp to install a route that will be blackholed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-12 08:33:37 -04:00
Donald Sharp
1f1d24a8f1 zebra: Allow recursively resolved blackhole routes to be installed
So the current code for a blackhole route assumed that you
would never want a recursively resolved blackhole to work.
Suppose you have this setup:

1) ip route 192.0.2.1/32 Null0
2) BGP installed with a route-map that rewrites the
   nexthop to 192.0.2.1.

Zebra will end up with a recursive nexthop that resolves
to the blackhole.

The original rib install function assumed that we would never
want the ability to recursively resolve a blackhole route.
Instead just handle the blackhole as part of the nexthop_num = 1
case.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-12 08:33:37 -04:00
Donald Sharp
0a16efff9b zebra: Fix rib_update_table
We should only be operating RIB_UPDATE_IF_CHANGE on
types that zebra has control of.  We assume that
the calling routing protocol is going to take care
of their own route changes based upon the interface
state change.

Also try to re-organize the code a tiny bit to allow
it to fit better within a tabed world.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-11 13:35:26 -04:00
Donald Sharp
407c87a6c3 zebra: Fixup indentation
RNODE_FOREACH_RE... function calls were not properly being
indented when we switched over to the new format.  Let's fix
this issue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-11 13:35:23 -04:00
Donald Sharp
c9abf5584a zebra: Small performance improvement for garbage collection
There is no need to retrieve the zvrf *unless* we are doing
debugs.  So move the retrieval under the debug statement.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-11 11:12:03 -04:00
Nigel Kukard
446176bdec doc: Cleaned up BGP showing of information section
Signed-off-by: Nigel Kukard <nkukard@lbsd.net>
2017-09-11 09:13:03 +00:00
Nigel Kukard
4f65c0d630 doc: English language cleanup
Signed-off-by: Nigel Kukard <nkukard@lbsd.net>
2017-09-11 09:12:04 +00:00
Nigel Kukard
47e7c0b971 doc: Moved AS regular expressions to BGP regular expressions
Regular expressions are used throughout in bgp commands, it
should not be in a section under as paths which cannot be
easily found.

Signed-off-by: Nigel Kukard <nkukard@lbsd.net>
2017-09-11 09:12:04 +00:00
Nigel Kukard
b0e019cc0c doc: Clarified the use of show bgp ipv4/ipv6 for communities
Signed-off-by: Nigel Kukard <nkukard@lbsd.net>
2017-09-11 09:12:04 +00:00
David Lamparter
953d97fc4a Merge pull request #1154 from donaldsharp/bgp_aspath
bgpd: Fix AS_PATH size calculation for long paths
2017-09-11 11:05:08 +02:00
David Lamparter
3a4ed171c6 Merge pull request #1142 from nkukard/lc-docs-master
docs: Added large-community documentation
2017-09-11 11:03:20 +02:00
David Lamparter
848e7ccac4 Merge pull request #1084 from donaldsharp/zebra_frame
zebra: Fix vty_frame usage in zebra
2017-09-11 11:01:39 +02:00
David Lamparter
29b32df94d Merge pull request #1149 from qlyoung/fix-thread-master-name-leak
lib: free thread master name
2017-09-11 10:47:04 +02:00
David Lamparter
937652c6e4 *: fix be32 reading / 24-bit left shift
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-09-09 19:50:58 +02:00
Quentin Young
4e1000a188
lib: free thread master name
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-09-08 16:39:53 -04:00
David Lamparter
5cf0c43de6 Merge pull request #1143 from dwalton76/frr-reload-vni
tools: frr-reload.py support for vni under 'address-family l2vpn evpn'
2017-09-08 17:35:23 +02:00
Quentin Young
2e4b945a75 Merge pull request #1137 from subsecond/documentation
Typos and formatting
2017-09-08 10:59:13 -04:00
Daniel Walton
7918b33541 tools: frr-reload.py support for vni under 'address-family l2vpn evpn'
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2017-09-08 13:27:23 +00:00
Nigel Kukard
ca383542dd docs: Added large-community documentation
Closes #1140

Signed-off-by: Nigel Kukard <nkukard@lbsd.net>
2017-09-08 12:40:17 +00:00
Andreas Jaggi
084002351f bgpd: Fix AS_PATH size calculation for long paths
If you have an AS_PATH with more entries than
what can be written into a single AS_SEGMENT_MAX
it needs to be broken up.  The code that noticed
that the AS_PATH needs to be broken up was not
correctly calculating the size of the resulting
message.  This patch addresses this issue.

This patch was built from an email that Andreas
sent to the dev alias for FRRouting.

Fixes: #1114
Signed-off-by: Andreas Jaggi <aj@open.ch>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-08 07:54:03 -04:00
Manuel Schweizer
c730652f80 Typos and formatting 2017-09-08 12:36:23 +02:00
Daniel Walton
b1eec2516a Merge pull request #1118 from opensourcerouting/attr-kill-master
kill bgp attr badness
2017-09-07 15:23:28 -04:00
Daniel Walton
43fba41d39 Merge pull request #1127 from opensourcerouting/connected_duplicates
zebra: allow multiple connected routes for the same prefix
2017-09-07 15:19:56 -04:00
Renato Westphal
b200bb7484 Merge pull request #1124 from donaldsharp/pim_igmp_fix
pimd: We do not need to BINDTODEVICE for default vrf
2017-09-07 15:04:54 -03:00
Renato Westphal
c2713b2acb zebra: allow multiple connected routes for the same prefix
With unnumbered interfaces on Linux we have the same IP address configured
on several different interfaces and hence multiple connected routes for
the same prefix.

With that said, add an exception in rib_add() to allow zebra to keep
track of all connected routes. We don't need to worry about the bugs
reported in a3d18ce because connected routes are always added from the
connected_up() function, and connected_update() already takes care of
handling duplicate addresses per interface.

Fixes #1112.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-09-07 15:00:42 -03:00
Donald Sharp
91288c42f8 Merge pull request #1122 from opensourcerouting/non-recursive-3
non-recursive pimd & tools & watchfrr
2017-09-07 11:27:17 -04:00
Donald Sharp
d1ee84e951 pimd: We do not need to BINDTODEVICE for default vrf
The changes introduced in PR #1044 caused pim to notice
when a setsockopt call failed.  The kicker here is that
this used to just work because we ignored the issue
pre.  So VRF's need to BINDTODEVICE to get igmp callbacks
but the default vrf does not need to do so.

With the fix we now see IGMP group join:
root@dell-s6000-02 ~/frr# vtysh -c "show ip igmp group"
Interface Address         Group           Mode Timer    Srcs V Uptime
br1       20.0.11.1       232.2.3.4       EXCL 00:04:14    1 3 00:00:05

Fixes: #1121
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-07 11:14:30 -04:00
David Lamparter
35a3c3c132 build: non-recursive pimd
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-09-07 16:20:42 +02:00
David Lamparter
bd354725a6 build: non-recursive watchfrr & tools
(also forgot to remove AC_SUBST(ISISD) earlier)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-09-07 16:18:50 +02:00
David Lamparter
be054588b4 bgpd: fix compiler warning
bgp_route.c:6393:7: error: ‘len’ may be used uninitialized in this function
gcc 5.4.0 isn't intelligent enough to notice it's set on all paths.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-09-07 15:31:50 +02:00
David Lamparter
dbbac180c1 bgpd: add comment on bgp_attr_intern
This is confusing enough to warrant a comment.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-09-07 15:29:32 +02:00
David Lamparter
821127e041 bgpd: remove transit_dup() & cluster_dup()
These are now unused.  route-maps can't modify these attributes, so
there is no need for _dup functions.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-09-07 15:29:32 +02:00
David Lamparter
b4cb15c667 bgpd: rip out bgp_attr_deep_dup(), fix table-map
bgp_attr_deep_dup is based on a misunderstanding of how route-maps work.
They never change actual data, just pointers & fields in "struct attr".
The correct thing to do is copy struct attr and call bgp_attr_flush()
afterwards.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-09-07 15:19:06 +02:00
David Lamparter
7c87afac92 bgpd: kill bgp_attr_refcount()
This attempt at optimization has cost us more than a week's worth of
time on several people hunting down the subtle bug that it was missing
an increment on attr->lcommunity.

This is absolutely not worth the maintenance cost.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-09-07 14:56:08 +02:00
David Lamparter
96099b4030 bgpd: add safety check on ATTR_FLAG_BIT
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-09-07 14:54:42 +02:00
David Lamparter
a7e5e20a22 Merge pull request #1099 from donaldsharp/hashing
Hashing
2017-09-07 11:35:07 +02:00
David Lamparter
cbd1fec331 Merge pull request #1105 from qlyoung/fixup-hashtable-stats-aaa
vtysh: complete 40818cec
2017-09-07 11:34:18 +02:00
David Lamparter
ea5455d58d Merge pull request #1113 from qlyoung/vtysh-pathspace-fix
vtysh: fix pathspace
2017-09-07 11:33:32 +02:00
Quentin Young
bd29d4638b
vtysh: fix pathspace
It didn't work

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-09-06 17:33:40 -04:00
Renato Westphal
51ce5c716c Merge pull request #1092 from donaldsharp/unreachable
Grab bag of issues
2017-09-05 21:57:44 -03:00
Donald Sharp
f826558015 bgpd: Cleanup rmap name memory leak
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-05 18:56:40 -04:00
Donald Sharp
21dfc9ed50 eigrpd: Clean up some new coverity issues
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-05 18:56:40 -04:00
Donald Sharp
76260b3578 pimd: Add usage of vty_frame for vrf configuration
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-05 18:56:40 -04:00
Donald Sharp
915902cb82 zebra: Allow zebra to delete self originated routes
With the change to make zebra pass routes to the kernel
with the 'correct' proto name, it caused zebra to
not properly recognize them on startup again
the next time such that the route would not
be deleted.

Modify rt_netlink.c to notice that we have a
self originated route and to properly mark
the type of route it was.

Modify rib_table_sweep to mark the nexthops
as active so that when we go to delete the
self originated routes it would properly
delete from the kernel.

Fixes: #1061
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-05 18:56:36 -04:00
Donald Sharp
8462c0ff42 nhrpd: Add hash table names
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-05 14:33:06 -04:00