Donald Sharp [Thu, 6 Apr 2017 00:07:46 +0000 (20:07 -0400)]
eigrpd: Fix massive memory leak
Each call into eigrp_topology_get_successors would leak the list
created. As routes worked their way through the FSM we would
leak memory left and right.
Modify the eigrp_topology_get_successor to return NULL when
there are no SUCCESORS.
Clean up some dead code.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Mon, 20 Mar 2017 00:29:35 +0000 (20:29 -0400)]
eigrpd: Fix non-installation of routes into zebra
EIGRP was not installing routes it learned from it's
neighbors into the rib.
This is probably a hack, but zebra now knows about the
routes.
robot.cumulusnetworks.com# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, P - PIM, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct,
> - selected route, * - FIB route
K>* 0.0.0.0/0 via 10.0.2.2, enp0s3
C>* 10.0.2.0/24 is directly connected, enp0s3
E 192.168.2.0/24 [0/0] via 127.0.0.1, enp0s10 inactive
C>* 192.168.2.0/24 is directly connected, enp0s10
E>* 192.168.3.4/32 [0/0] via 192.168.2.144, enp0s10
E>* 192.168.4.5/32 [0/0] via 192.168.2.144, enp0s10
E>* 192.168.4.6/32 [0/0] via 192.168.2.144, enp0s10
C>* 192.168.22.11/32 is directly connected, lo
robot.cumulusnetworks.com# show ip route 192.168.4.5
Routing entry for 192.168.4.5/32
Known via "eigrp", distance 0, metric 0, best
* 192.168.2.144, via enp0s10
robot.cumulusnetworks.com#
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Mon, 20 Mar 2017 00:21:47 +0000 (20:21 -0400)]
eigrpd: Fix communication w/ Zebra
We were not properly sending data to zebra for
route installation.
I removed the metric installation because I am not sure
if we've actually been passed the metric to install.
if we need it it can be added back in later.
Additionally cleaned up some silliness in eigrp_topology.c
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
anuradhak [Thu, 9 Mar 2017 19:42:55 +0000 (11:42 -0800)]
pimd: display reg-state and join-state info in the pim_upstream output
Changed the state field in the "sh ip pim upstream" output to include
register and join state info as a comma separated value. Register info
is supressed if reg-state=NoInfo.
Sample output:
=============
root@fhr:/home/cumulus# net show pim upstream
Iif Source Group State Uptime JoinTimer
RSTimer KATimer RefCnt
swp1 33.1.1.1 239.1.1.2 J,RegP 00:00:18 --:--:--
00:00:44 00:03:24 2
root@fhr:/home/cumulus#
root@rp:/home/cumulus# net show pim upstream
Iif Source Group State Uptime JoinTimer
RSTimer KATimer RefCnt
lo * 239.1.1.2 J 00:02:08 00:00:52
--:--:-- --:--:-- 1
swp1 33.1.1.1 239.1.1.2 J 00:00:16 00:00:11
--:--:-- 00:03:26 1
root@rp:/home/cumulus#
anuradhak [Thu, 9 Mar 2017 18:47:50 +0000 (10:47 -0800)]
pimd: simplify pim upstream state transitions
This is another follow-up change to the reg-state and up-join-state
separation. The upstream join state machine can now respond to
JoinDesired macro changes independent of router role.
I have also dropped the PRUNE state from the upstream-join-state
enumeration. RFC4601 only defines JOINED and NOTJOINED states. And PRUNE
can really be replace by NOTJOINED.
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-14700
Testing Done: Register state machine in FHR only, combined FHR-RP and
FHR-RP-LHR/all-in-one setups. Also ran pim-smoke.
anuradhak [Thu, 9 Mar 2017 17:52:59 +0000 (09:52 -0800)]
pimd: add new/distinct enumeration for pim register state
With the separation of register-state and upstream-join-state we no
longer need an enumeration that covers both states. This commit includes
the following -
1. Defined new enumeration for reg state (this 1:1 with RFC4601).
2. Dropped JOIN_PENDING enum value from upstream join state. RFC4601
only define two values NOT_JOINED and JOINED for this state.
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-14700
Testing Done: Verified register setup manually and ran pim-smoke
anuradhak [Wed, 8 Mar 2017 17:29:40 +0000 (09:29 -0800)]
pimd: Separate the register and upstream join states on the FHR
On the FHR upstream-join-state is not particularly relevant as we
don't need to send upstream JPs for the SG. So that field was being
overloaded with the register-state. However some of the events that
triggered changes to the JoinDesired macro were accidentally overwriting
the state with join info (instead of treating it as register info)
confusing the register state machine.
To make the PIM RFC macros' implemention simple I have separated out
the register-state. And upstream->state now solely describes the
upstream-join-state independent of the role of the PIM router.
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-14700
Testing Done: verified pim-register state-machine with separate and
combined FHR/RP routers. Also ran pim-smoke.
Donald Sharp [Fri, 10 Mar 2017 00:37:23 +0000 (19:37 -0500)]
zebra: Fix specific prefix handling
Suppose we are handling the process_workq and either a new static
route is installed or a Routing Protocol installs a new route.
We will call evaluate_rnh with a specific prefix. We might
have a situation where we clear the NHC flag prematurely.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The patch actually made the situation worse since the return value from
cmd_complete_command_real() was now inconsistently allocated from
different memory stat pools.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Donald Sharp [Tue, 7 Mar 2017 20:13:04 +0000 (15:13 -0500)]
zebra: Notify all nexthops that we've changed
Zebra when it was scanning the tree would unset NEXTHOPS_CHANGED
after the first notification. If the route we are notifying because
of covers multiple interesting nexthops then we would be unable
to know that we need to notify for that one as well because of
the flag removal.
Ticket: CM-15157 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
David Lamparter [Wed, 8 Mar 2017 15:13:12 +0000 (16:13 +0100)]
*: fix some user-visible Quagga remnants
(Note: the allow_delete thing is called "zebra" on the commandline
because that's the clearest context there, while it is called "FRR" in
the CLI because that's considerably less confusing in a vtysh env.)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Timo Teräs [Tue, 14 Feb 2017 11:07:39 +0000 (13:07 +0200)]
distro/redhat: package nhrpd
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
[DL: adapted for FRR, changed port number 2612->2610] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
In file included from netlink_gre.c:15:0:
/usr/include/linux/ipv6.h:19:8: error: redefinition of 'struct in6_pktinfo'
struct in6_pktinfo {
^
In file included from netlink_gre.c:10:0:
/usr/include/netinet/in.h:536:8: note: originally defined here
struct in6_pktinfo
^
In file included from netlink_gre.c:15:0:
/usr/include/linux/ipv6.h:24:8: error: redefinition of 'struct ip6_mtuinfo'
struct ip6_mtuinfo {
^
In file included from netlink_gre.c:10:0:
/usr/include/netinet/in.h:543:8: note: originally defined here
struct ip6_mtuinfo
So instead of libc's netinet/in.h include kernel's linux/in.h
and the add sys/socket.h for struct sockaddr since it does not
seem to be defined in kernel headers.
Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Timo Teräs [Thu, 19 Jan 2017 15:27:01 +0000 (17:27 +0200)]
nhrpd: implement next hop resolution protocol
This provides DMVPN support and integrates to strongSwan. Please read
README.nhrpd and README.kernel for more details.
[DL: cherry-picked from dafa05e65fe4b3b3ed5525443f554215ba14f42c]
[DL: merge partially resolved, this commit will not build.] Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Donald Sharp [Mon, 6 Mar 2017 13:16:43 +0000 (08:16 -0500)]
bgpd, zebra: Add ifindex to NEXTHOP_TYPE_IPV4
When passing up NEXTHOP_TYPE_IPV4 pass up the ifindex as well
Zebra already stores this data by passing it up PIM will be
able to use NEXTHOP_TYPE_IPV4 without having to do a recursive
lookup.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: Chirag Shah <chirag@cumulusnetworks.com>