Fix: reverse logic of when to pass the supplied group address
This was causing a crash when no group address was passed
because a garbage pointer valuse was used. It also was ignoring
the group address when passing one.
We shouldn't check the operational status of an interface in ldpd if
it's configured with "no link-detect" in zebra. That's what all the
other routing daemons do.
Restore the original logic in netlink_link_change() which works like this:
* once an interface event is detected, lookup the associated interface
by its name;
* call the set_ifindex() function;
* set_ifindex() will lookup the interface again but now by its ifindex. If
the lookups by name and ifindex yield to different results, then the
interface was renamed and set_ifindex() will take care of that.
In the future, zns->if_table will be split into two different data
structures to allow faster lookups by both name and ifindex.
zebra: fix infinite loop when deleting non-default vrf
How to reproduce the bug:
% ip link add vrf-red type vrf table 10
% ip link set dev vrf-red up
% ip rule add oif vrf-red table 10
% ip rule add iif vrf-red table 10
% ip link add name lo1 type dummy
% ip link set dev lo1 up
% ip link set dev lo1 master vrf-red
% ip link del dev vrf-red
(zebra gets stuck in an infinite loop inside work_queue_run())
The use of VTY_DECLVAR_CONTEXT(bgp, bgp) here is wrong as we are not
inside the "router bgp" configuration node. This was making the clear
commands always fail with a "Current configuration object was deleted
by another process" error, which doesn't make any sense.
Also, the bgp_clear() function will already check for us if the given
peer-group or neighbor exists or not, there's no need to duplicate this
logic here.
Chirag Shah [Tue, 25 Apr 2017 05:32:23 +0000 (22:32 -0700)]
pimd: fix pimd crashes around pim rpf
During neighbor down event, all upstream entries rpf lookup may result
into nhop address with 0.0.0.0 and rpf interface info being NULL.
Put preventin check where rpf interface info is accessed.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Chirag Shah [Fri, 21 Apr 2017 22:08:03 +0000 (15:08 -0700)]
pimd: Fix WG/SGRpt & WG J/P processing
During processing of Join/Prune,
for a S,G entry, current state is SGRpt, when only *,G is
received, need to clear SGRpt and add/inherit the *,G OIF to S,G so
it can forward traffic to downstream where *,G is received.
Upon receiving SGRpt prune remove the inherited *,G OIF.
Testing Done:
Trigger SPT switchover, *,G path received SGRpt later data
traffic stopped S,G ages out from LHR, sends only
*,G join to upstream, verified S,G entry inherit the OIF.
Upon receiving SGRpt deletes inherited oif and retains in SGRpt state.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Chirag Shah [Tue, 25 Apr 2017 05:01:34 +0000 (22:01 -0700)]
pimd: Enable igmp on igmp version change cli
Execute ip igmp version 3 under swp interface,
verified show running displayed 'ip igmp' configuration.
Continuous sending group membership, performed 'no ip igmp'
and verified, group membership flushed. Performed
'ip igmp version 3', verified 'show ip igmp groups'
displaying igmp membership re-populated.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Chirag Shah [Wed, 5 Apr 2017 20:14:12 +0000 (13:14 -0700)]
pimd: Pim Nexthop Tracking support with ECMP
In this patch, PIM nexthop tracking uses locally populated nexthop cached list
to determine ECMP based nexthop (w/ ECMP knob enabled), otherwise picks
the first nexthop as RPF.
Introduced '[no] ip pim ecmp' command to enable/disable PIM ECMP knob.
By default, PIM ECMP is disabled.
Intorudced '[no] ip pim ecmp rebalance' command to provide existing mcache
entry to switch new path based on hash chosen path.
Introduced, show command to display pim registered addresses and respective nexthops.
Introuduce, show command to find nexthop and out interface for (S,G) or (RP,G).
Re-Register an address with nexthop when Interface UP event received,
to ensure the PIM nexthop cache is updated (being PIM enabled).
During PIM neighbor UP, traverse all RPs and Upstreams nexthop and determine, if
any of nexthop's IPv4 address changes/resolves due to neigbor UP event.
Testing Done: Run various LHR, RP and FHR related cases to resolve RPF using
nexthop cache with ECMP knob disabled, performed interface/PIM neighbor flap events.
Executed pim-smoke with knob disabled.
Martin Winter [Wed, 12 Apr 2017 23:00:43 +0000 (16:00 -0700)]
snapcraft: Improve README.usage.md based on feedback received
- Fix snap connect (it's now called core, not ubuntu-core)
- Add section on MPLS configuration
- Add FAQ topic on ospfd/ospf6d crashing before privs are assigned to snap
- Add pointer to official webpage
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
Donald Sharp [Thu, 20 Apr 2017 14:12:41 +0000 (10:12 -0400)]
pimd: Convert pim_ifchannel_list to use up->ifchannels
We have a bunch of places where we iterate over
the pim_ifchannel_list to find those ifchannels
that match a certain upstream. Since we already
know in the upstream the list of ifchannels
associated with it, just look at those instead.
Donald Sharp [Thu, 20 Apr 2017 13:03:47 +0000 (09:03 -0400)]
pimd: Limit search to relevant ifchannels in some cases
When we are determining an inherited_olist, let's be allot
smarter about what we look at. Before this code change
we are looping over the entirety of all ifchannels in
the system to find the relevant ones. Convert the
code to *find*(hash table lookup) the specific ifchannels we
are interested in.
Ticket: CM-15629 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd: fixes for the "show bgp large-community" command
* Fix a segfault when the "show bgp large-community" command is given
without any optional large communities;
* Fix parsing of optional large communities. Without this fix a
"Large-community malformed" error is shown even for valid large
communities.
Donald Sharp [Sat, 8 Apr 2017 12:47:59 +0000 (08:47 -0400)]
ospfd: Fix the 'show ip ospf int ...' command
Fixed output:
robot.cumulusnetworks.com# show ip ospf int
enp0s3 is up
ifindex 2, MTU 1500 bytes, BW 0 Mbit <UP,BROADCAST,RUNNING,MULTICAST>
Internet Address 10.0.2.15/24, Broadcast 10.0.2.255, Area 0.0.0.0
MTU mismatch detection:enabled
Router ID 192.168.0.1, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State Waiting, Priority 1
No backup designated router on this network
Multicast group memberships: OSPFAllRouters
Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
Hello due in 9.611s
Neighbor Count is 0, Adjacent neighbor count is 0
enp0s10 is up
ifindex 7, MTU 1500 bytes, BW 0 Mbit <UP,BROADCAST,RUNNING,MULTICAST>
Internet Address 192.168.201.146/24, Broadcast 192.168.201.255, Area 0.0.0.0
MTU mismatch detection:enabled
Router ID 192.168.0.1, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State Waiting, Priority 1
No backup designated router on this network
Multicast group memberships: OSPFAllRouters
Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
Hello due in 7.241s
Neighbor Count is 0, Adjacent neighbor count is 0
robot.cumulusnetworks.com# show ip ospf int enp0s3
enp0s3 is up
ifindex 2, MTU 1500 bytes, BW 0 Mbit <UP,BROADCAST,RUNNING,MULTICAST>
Internet Address 10.0.2.15/24, Broadcast 10.0.2.255, Area 0.0.0.0
MTU mismatch detection:enabled
Router ID 192.168.0.1, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State Waiting, Priority 1
No backup designated router on this network
Multicast group memberships: OSPFAllRouters
Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
Hello due in 2.915s
Neighbor Count is 0, Adjacent neighbor count is 0
Donald Sharp [Thu, 23 Mar 2017 01:07:57 +0000 (21:07 -0400)]
pimd: Allow SPT switchover
This allows SPT switchover for S,G upon receipt of packets
on the LHR.
1) When we create a *,G from a IGMP Group Report, install
the *,G route with the pimreg device on the OIL.
2) When a packet hits the LHR that matches the *,G, we will
get a WHOLEPKT callback from the kernel and if we cannot
find the S,G, that means we have matched it on the LHR via
the *,G mroute. Create the S,G start the KAT and run
inherited_olist.
3) When the S,G times out, safely remove the S,G via
the KAT expiry
4) When the *,G is removed, remove any S,G associated
with it via the LHR flag.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Wed, 5 Apr 2017 00:36:16 +0000 (20:36 -0400)]
doc: Cleanup 'Build the Software'
The frrouting.org web page:
https://frrouting.org/manual/Build-the-Software.html#Build-the-Software
is built from doc/install.texi. The output on this page is a bit
missleading, let's clean it up some.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Tue, 4 Apr 2017 19:20:52 +0000 (15:20 -0400)]
vtysh: Fix build for non-snmp case
The snmp code is being included in the build of the vtysh_cmd.c
irrelevant of whether or not it is needed. Be a bit smarter
about what files to include.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Tue, 4 Apr 2017 19:25:19 +0000 (21:25 +0200)]
build: fix CFLAGS for snmp modules
The SNMP modules include <net-snmp/net-snmp-config.h>, which won't be
found in off-searchpath directories without SNMP_CFLAGS. Unfortunately
in my tests the files were on the search path even without the flags.
(SNMP_LIBS is not needed because only libfrrsnmp calls into net-snmp
functions.)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>