Commit Graph

17715 Commits

Author SHA1 Message Date
Donald Sharp
6c8b51e172 lib: Add a couple functions to nexthop_group.c
Add nexthop_group_copy and nexthop_group_add_sorted functions.

nexthop_group_copy -> Copy src nexthop_group into dst nexthop_group
nexthop_group_add_sorted -> Adds a new nexthop to the nexthop group
in a sorted manner.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-25 22:58:47 -04:00
Donald Sharp
60bc8d619c vtysh: Try to be perscriptive about pam failures
When using pam for authentication, the code just silently
fails and gives no indication to the end user what has gone
wrong.  Try to increase messaging about what has gone wrong
by outputting some more data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-25 20:14:25 -04:00
Sri Mohana Singamsetty
f3afd0a4e1
Merge pull request #4575 from nitinsoniism/show_mac_arp_cache_vni_json_fix
zebra: show evpn mac vni xx json output is broken
2019-06-25 17:03:14 -07:00
Donald Sharp
a56ec5c0e9 zebra: When installing route use a good proto
When installing a table route into the kernel choose
RTPROT_ZEBRA as the installing/controlling protocol.

This way we can know we installed it as well as stop
the warnings about this special case of `ip import-table XX`

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-25 17:49:42 -04:00
Donald Sharp
317c6a1028 zebra: import table entries are not showing up in the right table
When we are importing/removing the table entry from table X into the
default routing table we are not properly setting the table_id
of the route entry.  This is causing the route to be pushed
into the wrong internal table and to not be found for deletion.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-25 17:49:19 -04:00
Donald Sharp
fe257ae733 zebra: Push VRF_DEFAULT outside of import table code
The import table code assumes that they will only work
in the default vrf.  This is ok, but we should push the
vrf_id and zvrf to be passed in instead of just using
VRF_DEFAULT.

This will allow us to fix a couple of things:

1) A bug in import where we are not creating the
route entry with the appropriate table so the imported
entry is showing up in the wrong spot.

2) In the future allow `ip import-table X` to become
vrf aware very easily.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-25 17:47:41 -04:00
Donald Sharp
7505ec52aa zebra: Use correct parameter order for table lookup up.
The import-table code when looking up the table to use
for route-import was reversing the order of the table_id
and vrf_id causing us to never ever lookup a table
and we would cause the `ip|ipv6 import-table X` commands
to be just ignored.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-25 17:47:41 -04:00
Donald Sharp
82d7d0e28a zebra: Improve debugging when we can't find a route to delete
Improve debugging when we cannot find a route to delete
that we have been told to delete.

New output:

2019/06/25 17:43:49 ZEBRA: default[0]:4.5.6.7/32 doesn't exist in rib
2019/06/25 17:43:49 ZEBRA: default[0]:4.5.6.8/32 doesn't exist in rib

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-25 17:47:41 -04:00
Rafael Zalamena
9b2d87406a
Merge pull request #4525 from donaldsharp/some_cleanups
Some cleanups
2019-06-25 16:06:57 -03:00
Sri Mohana Singamsetty
4b7269c42f
Merge pull request #4570 from donaldsharp/route_map_clear
lib: Add `clear route-map counters [WORD]` command
2019-06-25 10:34:11 -07:00
Renato Westphal
6db25b9ef7
Merge pull request #4606 from donaldsharp/no_redist_fixup
bgpd: Fixup `no redistribute ...` commands to allow any order
2019-06-25 13:34:27 -03:00
Quentin Young
878918edaa
Merge pull request #4522 from LabNConsulting/working/master/issue4479
bgpd: address issue #4479 crash during instance removal
2019-06-25 11:45:19 -04:00
Sri Mohana Singamsetty
06dbe9ec34
Merge pull request #4544 from chiragshah6/mdev
bgpd: print ecom in evpn route output
2019-06-25 08:45:04 -07:00
Donald Sharp
5bc97e1b54
Merge pull request #4458 from karamalla0406/frr4123
zebra: Clean up BGP EVPN configuration when the client, BGPD, goes down
2019-06-25 11:30:14 -04:00
Stephen Worley
018fa5f85d doc: Add a performance note for log filtering
Add a not under the log-filter command to indicate
that, while filtering reduces load on the system by
large margins, there may still be a small performance
hit from filtering those.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-06-25 10:49:43 -04:00
Donald Sharp
0d7b9179a1
Merge pull request #4603 from opensourcerouting/vty-recursion
lib: add a check for {[...]} in DEFUNs
2019-06-25 09:19:57 -04:00
Rafael Zalamena
fdf8ac87f8 bfdd: convert bfd command to northbound
This helps northbound to create the `bfd` node on the configuration
output sooner than adding a peer.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-06-25 09:34:14 -03:00
David Lamparter
ea1bdfc0e5
Pim bug fixes (#4519)
Pim bug fixes

Co-authored-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-06-25 14:08:48 +02:00
David Lamparter
7492e8514b
Merge pull request #4588 from donaldsharp/vrrp_access_list
vrrpd: Allow vrrp to gracefully ignore access list commands
2019-06-25 14:08:08 +02:00
Rafael Zalamena
77452ad263 bfdd: small tweaks on northbound
* Change `ERR_VALIDATION` to `ERR_INCONSISTENCY` to error on
    inconsistent state.
  * Duplicated sanity checks:
    * Remove detection multiplier sanity check.
    * Remove duplicated session sanity check.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-06-25 09:06:48 -03:00
David Lamparter
18130847e6
Merge pull request #4520 from rgirada/fix_clear_mroute
pimd: Added cli to generate igmp query.
2019-06-25 14:06:13 +02:00
David Lamparter
b80aedb577
Merge pull request #4584 from donaldsharp/rib_detail_improvements
zebra logging improvements
2019-06-25 14:03:55 +02:00
David Lamparter
eb44e1aac0 lib: add a check for {[...]} in DEFUNs
Our command matcher doesn't handle {[...]} correctly;  let's warn about
it so the DEFUN can be changed to [{...}] (which does work as expected.)

Fixes: #4594
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-06-25 13:35:21 +02:00
Donald Sharp
8890b440ac pimd: Dissallow query to be received from a non-connected source
When we receive an igmp query on a interface, ensure that the
source address of the packet is connected to the incoming
interface.  This will prevent a meanie from crafting a igmp
packet with a source address less than ours and causing
us to suspend query activities.

Fixes: #1692
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-25 00:30:11 -04:00
Donald Sharp
e27957c062 bgpd: Fixup no redistribute ... commands to allow any order
The `no redistribute ...` commands were not allowing
the input to be in any order.  Fix code to allow this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-24 19:51:51 -04:00
Rafael Zalamena
8e0c84ff27 bfdd: fix compilation warnings on OmniOS
Build will fail with `Werror` enabled with:

```
  CC       bfdd/bfdd_cli.o
In file included from ./lib/frratomic.h:21:0,
                 from ./lib/memory.h:22,
                 from ./lib/vector.h:25,
                 from ./lib/command.h:25,
                 from bfdd/bfdd_cli.c:23:
./config.h:665:0: error: "_FILE_OFFSET_BITS" redefined [-Werror]
 #define _FILE_OFFSET_BITS 64
 ^
In file included from /usr/include/iso/stdlib_iso.h:49:0,
                 from /usr/include/stdlib.h:37,
                 from ./lib/memory.h:20,
                 from ./lib/vector.h:25,
                 from ./lib/command.h:25,
                 from bfdd/bfdd_cli.c:23:
/opt/gcc-5.1.0/lib/gcc/i386-pc-solaris2.11/5.1.0/include-fixed/sys/feature_tests.h:231:0: note: this is the location of the previous definition
 #define _FILE_OFFSET_BITS 32
 ^
In file included from ./lib/thread.h:24:0,
                 from ./lib/vty.h:27,
                 from ./lib/command.h:26,
                 from bfdd/bfdd_cli.c:23:
./lib/zebra.h:271:2: error: #warning "assuming 4-byte alignment for CMSG_SPACE" [-Werror=cpp]
 #warning "assuming 4-byte alignment for CMSG_SPACE"
  ^
./lib/zebra.h:277:2: error: #warning "assuming 4-byte alignment for CMSG_LEN" [-Werror=cpp]
 #warning "assuming 4-byte alignment for CMSG_LEN"
  ^
cc1: all warnings being treated as errors
Makefile:6876: recipe for target 'bfdd/bfdd_cli.o' failed
gmake[1]: *** [bfdd/bfdd_cli.o] Error 1
```

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-06-24 13:42:40 -03:00
Rafael Zalamena
eefca51eb3 bfdd: fix compilation warnings on OpenBSD
Build will fail with `Werror` enabled with:

```
bfdd/bfdd_northbound.c:876: warning: initialized field overwritten
bfdd/bfdd_northbound.c:876: warning: (near initialization for 'frr_bfdd_info.nodes[0].cbs')
...
cc1: error: unrecognized command line option "-Wno-unused-result"
gmake[1]: *** [Makefile:6875: bfdd/bfdd_northbound.o] Error 1
```

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-06-24 11:46:29 -03:00
Donald Sharp
2962897782 staticd: If we are told a nexthop has changed reinstall the route.
If we are told that a dependant nexthop has changed, just
reinstall the route.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-24 10:46:24 -04:00
Donald Sharp
60c67010f2 zebra: Fix rnh old -vs- new comparison
1) If we are moving the nexthop we are tracking to
a new rn in the rib, then we know that the route
to get to that nexthop has changed.  As such
we should notify the upper level.

This manifested itself because the code had a trigraph `?`
in the wrong order.  Put the comparison in the right order.

2) If we are re-matching to the same rn and we call compare_state
then we need to see if our stored nexthops are the same or different.

If they are the same we should not notify.  If they are different
we should notify.  compare_state was only comparing the flags
on a route and since those are not necessarily the right flags
to look at( and we are well after the fact that the route has
already changed and been processed ) let's just compare
the nexthops to see if they are the same or different.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-24 09:50:55 -04:00
rgirada
6741a5bb4e pimd: Added cli to generate igmp query.
Fix details :
Added a utility cli to generate a igmp query on an interface.
This won't impact the existing query generation based on the
general query interval.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2019-06-24 03:15:10 -07:00
Emanuele Di Pascale
614a0f8613 zebra: fix label manager EAGAIN error
when receiving an EAGAIN while trying to read the header
of a ZAPI message, we were erroneously continuing as if
everything was fine, which could crash zebra. Fix this
by returning and letting the re-armed read task deal with
this

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2019-06-24 11:35:44 +02:00
Emanuele Di Pascale
ea63ff6bbd bgpd: fix LU label callback crash
under some conditions, the callback to get a label for
a LU bgp path could be called after the path had already
been freed. In this case we would be reading garbage
and potentially crash. Lock the path info before
queueing the callback, and unlock as the first step
of the callback, exiting gracefully if the path info
is now NULL.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2019-06-24 11:35:44 +02:00
Donald Sharp
0c3bbed4e6
Merge pull request #4597 from FRRouting/revert-3775-ospf_missing_interface_handling_2
Revert "Ospf missing interface handling 2"
2019-06-23 19:47:10 -04:00
Donald Sharp
a36898e755
Revert "Ospf missing interface handling 2" 2019-06-23 19:46:39 -04:00
Anuradha Karuppiah
71056a69c3 pimd: remove pim and igmp OIFs when ifchannel_delete happens
In a pim-evpn setup (say TORC11<=>TORC12) an mroute can have a mix of
PIM and IGMP joins. The vxlan termination device ipmr-lo is IGMP
joined on termination mroutes and the peerlink-rif can be pim joined
on the same mroute if the MLAG peer (TORC11) loses all its uplinks to
underlay -
root@TORC12:~# net show pim state 239.1.1.101|grep pimreg
1         *                239.1.1.101      uplink-1
             pimreg(I    ), ipmr-lo( J   ), peerlink-3.4094( J   )
root@TORC12:~#

When the uplinks come back up on TORC11 it will prune the peerlink-rif
and join the RP (say spine) via the uplinks.

TORC12 is rxing the prune and removing the if_channel
(pim_ifchannel_delete). However it is not removing the OIF from
mfcc_ttl basically leaving behind a leaked OIF in the forwarding
entry. And this is because it is deriving the owner flag from the
parent upstream entry and incorrectly concluding that all OIFs are
IGMP joined.

Thix fix flushes out both PIM and IGMP ownership when the ifchannel is
deleted.

There is a second fix in the commit and that is to set the proto mask
correctly (to STAR) for inherited OIFs. (S,G) entries can inherit the
OIF from the (*, G) entry and this decision can change when the pim/igmp
ifchannel is removed. The earlier code was setting the proto-mask
incorrectly to PIM or IGMP.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit d4d1d968dbbe61347393f7dace8b675496ff1024)
2019-06-22 14:02:14 -04:00
Anuradha Karuppiah
3565802247 pimd: ensure that the oif is removed from all the mroutes pre-vifi deletion
When a link goes down the vifi was being deleted but the OIF stayed
in the OIL with a stale vifi -
oroot@act-7726-03:~# net show pim state
Codes: J -> Pim Join, I -> IGMP Report, S -> Source, * -> Inherited from (*,G), V -> VxLAN
Installed Source           Group            IIF               OIL
1         *                239.1.1.111      swp1s1            pimreg(I    ), ipmr-lo( J   )
1         6.0.0.28         239.1.1.111      lo                pimreg( J   ), ipmr-lo(    *), swp1s1( J   )
root@act-7726-03:~# ip link set swp1s1 down
root@act-7726-03:~# net show pim state
Codes: J -> Pim Join, I -> IGMP Report, S -> Source, * -> Inherited from (*,G), V -> VxLAN
Installed Source           Group            IIF               OIL
1         *                239.1.1.111      swp1s0            pimreg(I    ), ipmr-lo( J   )
1         6.0.0.28         239.1.1.111      lo                ipmr-lo(    *), swp1s0( J   ), <oif?>( J   ) >>>>>>>>
root@act-7726-03:~#

The problem was as a part ifchannel_delete the join state of the channel
was checked to avoid incorrect OIF deletion this was preventing the OIF
from being flushed. Fix is to flip the channel join-state to NOINFO before
deleting it.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-22 14:02:14 -04:00
Donald Sharp
1d75355169 ospfd: Cleanup ospf->redist and ospf->external on shutdown
These two data types were written to handle redistribute
and external data types.  On shutdown cleanup the memory
allocated to these if we are doing redistribution.

This was found using valgrind.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-22 13:58:30 -04:00
Donald Sharp
a12bb225a6
Merge pull request #3775 from pguibert6WIND/ospf_missing_interface_handling_2
Ospf missing interface handling 2
2019-06-22 13:35:45 -04:00
Donald Sharp
efe42c51c4
Merge pull request #4294 from adharkar/frr-master-fpm_rmac
Zebra: EVPN remote RMAC download via FPM channel using netlink msg format
2019-06-22 13:28:49 -04:00
Renato Westphal
a29ba5585d
Merge pull request #4586 from donaldsharp/default_originate
bgpd: `neighbor X:X::X default-originate` complains about (null)
2019-06-22 11:29:18 -03:00
Philippe Guibert
f7bb830439 bfdd: authorise multihop and interface setting
the restriction to authorise multihop and interface setting has no
meaning here.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-06-22 10:10:56 -03:00
Philippe Guibert
7818c5fba0 bfdd: add not '\n' to shutdown help string
help string had not a '\n' at the end of the line for bfd shutdown help
command.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-06-22 10:10:56 -03:00
Rafael Zalamena
8a676ce6b1 bfdd: use microseconds timers in YANG
Lets allow specification to accept microseconds, but limit the timers
configuration in FRR to milliseconds (minimum is 10 ms and maximum is 60
seconds).

This matches the RFC 5880 and the IETF BFD YANG draft model.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-06-22 10:10:56 -03:00
Rafael Zalamena
020a390649 lib: fix northbound static analyzer warning
Make the function parameter `const` so the analyzer doesn't suspect we
are trying to change its value.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-06-22 10:10:56 -03:00
Rafael Zalamena
2a573ff672 bfdd: support global BFD reset
Add command 'no bfd' to remove all BFD sessions configuration and fix
other daemon integration.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-06-22 10:10:56 -03:00
Rafael Zalamena
47a7b00c2d bfdd: fix daemon warning on startup
```
warnings: BFD: [EC 100663317] YANG model "frr-bfdd@*" not embedded, trying external file
```

Embed the YANG model into the binary to avoid reading an external file.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-06-22 10:10:56 -03:00
Rafael Zalamena
49cc9e7b64 bfdd: implement configuration reload
Reload configuration on SIGHUP using the northbound.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-06-22 10:10:56 -03:00
Rafael Zalamena
0030482f5e bfdd: fix northbound remote-discriminator display
When the remote discriminator hasn't been assigned yet, then we can't
return a value of 0. The value '0' is an invalid discriminator and the
yang handlers will complain about it.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-06-22 10:10:56 -03:00
Rafael Zalamena
0287a64a6e bfdd: implement write_config using northbound
Move all the `show running-config` logic to the new northbound
implementation.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-06-22 10:10:56 -03:00
Rafael Zalamena
adc26455bf bfdd: migrate session commands to northbound
Lets start using the new BFD yang model and translate the BFD session
configuration commands to use the northbound.

One important change: all sessions will default to use
`VRF_DEFAULT_NAME` (usually "default") when no VRF is configured. All
places which search for BFD sessions must now take this into account.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-06-22 10:10:56 -03:00