]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
4 years ago*: sprintf -> snprintf
Quentin Young [Mon, 20 Apr 2020 18:12:38 +0000 (14:12 -0400)]
*: sprintf -> snprintf

Replace sprintf with snprintf where straightforward to do so.

- sprintf's into local scope buffers of known size are replaced with the
  equivalent snprintf call
- snprintf's into local scope buffers of known size that use the buffer
  size expression now use sizeof(buffer)
- sprintf(buf + strlen(buf), ...) replaced with snprintf() into temp
  buffer followed by strlcat

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agotools: add more macros to cocci.h
Quentin Young [Mon, 20 Apr 2020 22:07:17 +0000 (18:07 -0400)]
tools: add more macros to cocci.h

Coccinelle needs to know about complicated macros to understand certain
code paths, add some more macros there.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #6245 from sworleys/NHG-More-Topo
Mark Stapp [Mon, 20 Apr 2020 17:28:14 +0000 (13:28 -0400)]
Merge pull request #6245 from sworleys/NHG-More-Topo

tests: add connected/recursive/duplicte/route-map NHG tests

4 years agoMerge pull request #6260 from ton31337/fix/01_to_bool
Donald Sharp [Mon, 20 Apr 2020 12:30:28 +0000 (08:30 -0400)]
Merge pull request #6260 from ton31337/fix/01_to_bool

bgpd: Use true/false for reject_as_sets

4 years agobgpd: Use true/false for reject_as_sets
Donatas Abraitis [Mon, 20 Apr 2020 09:59:52 +0000 (12:59 +0300)]
bgpd: Use true/false for reject_as_sets

Just remove MACROS and use true/false.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #6231 from dslicenc/v6-ra-hoplimit
Donatas Abraitis [Sat, 18 Apr 2020 19:48:20 +0000 (22:48 +0300)]
Merge pull request #6231 from dslicenc/v6-ra-hoplimit

zebra: add ability to set hoplimit for IPv6 RAs

4 years agoMerge pull request #6164 from ton31337/feature/rfc8212_enabled_traditional_profile
Donald Sharp [Sat, 18 Apr 2020 19:06:04 +0000 (15:06 -0400)]
Merge pull request #6164 from ton31337/feature/rfc8212_enabled_traditional_profile

bgpd: Enable rfc8212 by default except datacenter profile

4 years agoMerge pull request #6256 from qlyoung/pimd-no-strcpy
David Lamparter [Sat, 18 Apr 2020 18:47:32 +0000 (20:47 +0200)]
Merge pull request #6256 from qlyoung/pimd-no-strcpy

4 years agoMerge pull request #6257 from qlyoung/bitfield-no-null-check-before-free
David Lamparter [Sat, 18 Apr 2020 15:34:09 +0000 (17:34 +0200)]
Merge pull request #6257 from qlyoung/bitfield-no-null-check-before-free

4 years agoMerge pull request #6258 from donaldsharp/more_scan_more
David Lamparter [Sat, 18 Apr 2020 15:06:38 +0000 (17:06 +0200)]
Merge pull request #6258 from donaldsharp/more_scan_more

4 years agoospf6d: Prevent use after free
Donald Sharp [Sat, 18 Apr 2020 01:18:53 +0000 (21:18 -0400)]
ospf6d: Prevent use after free

ospf6_lsa_unlock may free the lsa data structure as such
we cannot use the passed in data structure after freeing it.

Provide a mechanism to know if the data has been freed
using the same usage patterns of other _unlock functions
in FRR.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoisisd: Prevent use after free for isis_adj_state_change
Donald Sharp [Sat, 18 Apr 2020 00:06:07 +0000 (20:06 -0400)]
isisd: Prevent use after free for isis_adj_state_change

When we call isis_adj_state_change with ISIS_ADJ_DOWN
we free the pointer, but we were still using the pointer
after it was freed.  Cleanup the api to prevent this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agolib: dont null check bitfield pointer before free
Quentin Young [Sat, 18 Apr 2020 00:19:33 +0000 (20:19 -0400)]
lib: dont null check bitfield pointer before free

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #6255 from mjstapp/fix_bitfield_free
Quentin Young [Sat, 18 Apr 2020 00:17:18 +0000 (20:17 -0400)]
Merge pull request #6255 from mjstapp/fix_bitfield_free

lib: clear data pointer in bf_free

4 years agolib: don't use strcpy
Quentin Young [Sat, 18 Apr 2020 00:05:34 +0000 (20:05 -0400)]
lib: don't use strcpy

>:(

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agopimd: don't use strcpy
Quentin Young [Fri, 17 Apr 2020 23:56:49 +0000 (19:56 -0400)]
pimd: don't use strcpy

>:(

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agolib: clear data pointer in bf_free
Mark Stapp [Fri, 17 Apr 2020 20:53:37 +0000 (16:53 -0400)]
lib: clear data pointer in bf_free

Help avoid double-free by clearing data pointer.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #6248 from donaldsharp/zebra_snmp
Donatas Abraitis [Fri, 17 Apr 2020 09:09:58 +0000 (12:09 +0300)]
Merge pull request #6248 from donaldsharp/zebra_snmp

some more coverity fixups

4 years agoMerge pull request #6240 from ton31337/fix/null_bnc_bgp_show_hostname
Sri Mohana Singamsetty [Fri, 17 Apr 2020 03:17:40 +0000 (20:17 -0700)]
Merge pull request #6240 from ton31337/fix/null_bnc_bgp_show_hostname

bgpd: Add a sanitify check for bgp_nexthop_cache against NULL

4 years agopimd: if_lookup_by_index can fail handle it appropriately
Donald Sharp [Fri, 17 Apr 2020 00:26:00 +0000 (20:26 -0400)]
pimd: if_lookup_by_index can fail handle it appropriately

It is possible that a if_lookup_by_index can return NULL
ensure that we handle this appropriately.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agolib: prefix must be a valid pointer at this point
Donald Sharp [Fri, 17 Apr 2020 00:17:22 +0000 (20:17 -0400)]
lib: prefix must be a valid pointer at this point

Coverity does not understand how our CLI works.  Make it
happy that we have tested it's existence

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoospfd: Fix possible null deref
Donald Sharp [Fri, 17 Apr 2020 00:16:02 +0000 (20:16 -0400)]
ospfd: Fix possible null deref

It is possible that area is null, let's ensure it isn't.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agozebra: in_addr_cmp and `struct prefix` are not happy
Donald Sharp [Fri, 17 Apr 2020 00:14:55 +0000 (20:14 -0400)]
zebra: in_addr_cmp and `struct prefix` are not happy

Coverity is complaining that we are looking beyond the end
of the pointer.  Why not just use prefix_cmp here?  Since
we are comparing to route_nodes.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #6247 from FRRouting/nb_conversions
Donald Sharp [Thu, 16 Apr 2020 23:39:14 +0000 (19:39 -0400)]
Merge pull request #6247 from FRRouting/nb_conversions

Merge nb_converions branch to master

4 years agoMerge pull request #6135 from opensourcerouting/cli-node-cleanup
Donald Sharp [Thu, 16 Apr 2020 23:24:56 +0000 (19:24 -0400)]
Merge pull request #6135 from opensourcerouting/cli-node-cleanup

*: clean up the mess that is CLI command nodes

4 years agoMerge pull request #6239 from ton31337/fix/uint8_t_to_bool_for_any
Quentin Young [Thu, 16 Apr 2020 19:40:03 +0000 (15:40 -0400)]
Merge pull request #6239 from ton31337/fix/uint8_t_to_bool_for_any

bgpd, lib: Use bool instead of uint8_t for community/prefix-list "any"

4 years agolib: suppress formatting on yang.c module array
Quentin Young [Thu, 16 Apr 2020 19:38:11 +0000 (15:38 -0400)]
lib: suppress formatting on yang.c module array

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5913 from taspelund/evpn_route_type_int
Donatas Abraitis [Thu, 16 Apr 2020 19:28:19 +0000 (22:28 +0300)]
Merge pull request #5913 from taspelund/evpn_route_type_int

bgpd: Allow 'show bgp l2vpn evpn route type' to use RT number in addition to existing keywords

4 years agoMerge pull request #6224 from mjstapp/zclient_session_id
Olivier Dugeon [Thu, 16 Apr 2020 19:12:30 +0000 (21:12 +0200)]
Merge pull request #6224 from mjstapp/zclient_session_id

lib,zebra: add a session id for zapi sessions

4 years agolib: fix style nit in yang_wrappers.c
Quentin Young [Thu, 16 Apr 2020 19:10:19 +0000 (15:10 -0400)]
lib: fix style nit in yang_wrappers.c

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agozebra,ldpd: use zapi client session id in LM apis
Mark Stapp [Wed, 15 Apr 2020 12:34:03 +0000 (08:34 -0400)]
zebra,ldpd: use zapi client session id in LM apis

Use the zapi client session id in the label manager apis;
use the client struct directly in some code. Assign a session
id to ldpd's sync LM zapi session.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agolib,zebra: add a session id for zapi sessions
Mark Stapp [Tue, 14 Apr 2020 14:45:09 +0000 (10:45 -0400)]
lib,zebra: add a session id for zapi sessions

Distinguish zapi sessions, for daemons who use more than one,
by adding a session id. The tuple of proto + instance is not
adequate to support clients who use multiple zapi sessions.
Include the id in the client show output if it's present. Add
a bit of info about this to the developer doc.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agozebra: add weight to nb conversion
Chirag Shah [Mon, 6 Apr 2020 21:20:43 +0000 (14:20 -0700)]
zebra: add weight to nb conversion

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoyang: add weight in nexthop operational model
Chirag Shah [Sat, 4 Apr 2020 06:08:58 +0000 (23:08 -0700)]
yang: add weight in nexthop operational model

add weight field to operational model.
add leafref to nexthopgroup.
format according to yanglint.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agolib: increase xpath maxlen
Chirag Shah [Sat, 4 Apr 2020 00:00:30 +0000 (17:00 -0700)]
lib: increase xpath maxlen

Certain xpath are well 256 characters, increasing
to 512.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agozebra: add northbound support for zebra interface
Chirag Shah [Tue, 25 Feb 2020 02:40:29 +0000 (18:40 -0800)]
zebra: add northbound support for zebra interface

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agotests: add connected/recursive/duplicte/route-map NHG tests
Stephen Worley [Mon, 13 Apr 2020 23:00:18 +0000 (19:00 -0400)]
tests: add connected/recursive/duplicte/route-map NHG tests

Add some more NHG topotests using connected, recursive, duplicate
and higher ecmp nexthops as well as route maps.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: remove gcc 4.x workaround for nb structure
Chirag Shah [Fri, 27 Mar 2020 02:00:52 +0000 (19:00 -0700)]
lib: remove gcc 4.x workaround for nb structure

Remove gcc 4.x workaround for variable size array as gcc
check moved to header file.

In lib/northbound.h : struct frr_yang_module_info made
size 1000 for gcc 4.x, where maximum 1000 nodes can fit.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agozebra: add nb callbacks for zebra if state
Chirag Shah [Thu, 20 Feb 2020 02:48:47 +0000 (18:48 -0800)]
zebra: add nb callbacks for zebra if state

This is all stub callbacks autogenrated for
zebra interface state data.

Signed-off-by: chirag Shah <chirag@cumulusnetworks.com>
4 years agolib: add interface operational northbound callback
Chirag Shah [Wed, 19 Feb 2020 21:26:41 +0000 (13:26 -0800)]
lib: add interface operational northbound callback

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoyang: update zebra interface model
Chirag Shah [Thu, 6 Feb 2020 03:19:09 +0000 (19:19 -0800)]
yang: update zebra interface model

Modify interface config model
and add zebra specific interface state operational data.

augment /frr-interface:lib/frr-interface:interface:
  +--rw zebra
     +--rw ip-addrs* [address-family ip-prefix]
     |  +--rw address-family    identityref
     |  +--rw ip-prefix         ietf-inet-types:ip-prefix
     |  +--rw label?            string
     |  +--rw ip4-peer?         ietf-inet-types:ipv4-prefix
     +--rw multicast?     boolean
     +--rw link-detect?   boolean
     +--rw shutdown?      boolean
     +--rw bandwidth?     uint32
     +--ro state
        +--ro up-count?      uint16
        +--ro down-count?    uint16
        +--ro zif-type?      identityref
        +--ro ptm-status?    string <disabled>
        +--ro vlan-id?       uint16
        +--ro vni-id?        vni-id-type
        +--ro remote-vtep?   ietf-inet-types:ipv4-address
        +--ro mcast-group?   ietf-routing-types:ipv4-multicast-group-address

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoyang: add operational data to frr-interface model
Chirag Shah [Wed, 5 Feb 2020 22:23:52 +0000 (14:23 -0800)]
yang: add operational data to frr-interface model

module: frr-interface
  +--rw lib
     +--rw interface* [name vrf]
        +--rw name           string
        +--rw vrf            frr-vrf:vrf-ref
        +--rw description?   string
        +--ro state
           +--ro if-index?      int32
           +--ro mtu?           uint16
           +--ro mtu6?          uint32
           +--ro speed?         uint32
           +--ro metric?        uint32
           +--ro flags?         if-flags-type
           +--ro type?          identityref
           +--ro phy-address?   ietf-yang-types:mac-address

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoyang: add ietf interface yang model
Chirag Shah [Tue, 4 Feb 2020 00:09:29 +0000 (16:09 -0800)]
yang: add ietf interface yang model

Add ietf interface yant model.
Also include it in the makefile.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoyang: igmp yang definition
Sarita Patra [Wed, 5 Feb 2020 08:52:27 +0000 (00:52 -0800)]
yang: igmp yang definition

Defined frr-igmp.yang file for IGMP protocol.

Co-authored-by: Sarita Patra <saritap@vmware.com>
Co-authored-by: Santosh P K <sapk@vmware.com>
Signed-off-by: Sarita Patra <saritap@vmware.com>
4 years agolib: yang wrapper nexthop type to str
Chirag Shah [Tue, 31 Mar 2020 02:29:32 +0000 (19:29 -0700)]
lib: yang wrapper nexthop type to str

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agolib: add yang wrapper for type empty
Chirag Shah [Sat, 21 Mar 2020 01:58:16 +0000 (18:58 -0700)]
lib: add yang wrapper for type empty

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agozebra: stub changes to assimilate re into rib nb
Chirag Shah [Tue, 10 Mar 2020 01:48:30 +0000 (18:48 -0700)]
zebra: stub changes to assimilate re into rib nb

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoyang: zebra rib model add route entry
Chirag Shah [Fri, 6 Mar 2020 05:43:41 +0000 (21:43 -0800)]
yang: zebra rib model add route entry

FRR rib model need to accomodate route entries for
a given destination prefix.

Add a list of route entry under the list of prefix.

+--rw ribs
   +--rw rib* [afi-safi-name table-id]
      +--rw table-id         uint32
      +--rw afi-safi-name    identityref
      +--ro route* [prefix]
         +--ro prefix         ietf-inet-types:ip-prefix
         +--ro route-entry* [protocol]
            +--ro protocol           frr-route-types:frr-route-types-v4
            +--ro instance?          uint16
            +--ro distance?          uint8
            +--ro metric?            uint32
            +--ro tag?               uint32
            +--ro selected?          empty
            +--ro installed?         empty
            +--ro failed?            empty
            +--ro queued?            empty
            +--ro internal-flags?    int32
            +--ro internal-status?   int32
            +--ro uptime?            ietf-yang-types:date-and-time
            +--ro nexthop-group* [name]
               +--ro name            string
               +--ro frr-nexthops
                  +--ro nexthop* [nh-type gateway interface]
                     +--ro nh-type             frr-nexthop:nexthop-type
                     +--ro vrf?                frr-vrf:vrf-ref
                     +--ro gateway             frr-nexthop:optional-ip-address
                     +--ro interface           frr-interface:interface-ref
                     +--ro bh-type?            frr-nexthop:blackhole-type
                     +--ro onlink?             boolean <false>
                     +--ro mpls-label-stack
                     |  +--ro entry* [id]
                     |     +--ro id               uint8
                     |     +--ro label?           ietf-routing-types:mpls-label
                     |     +--ro ttl?             uint8
                     |     +--ro traffic-class?   uint8
                     +--ro duplicate?          empty
                     +--ro recursive?          empty
                     +--ro active?             empty
                     +--ro fib?                empty

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoyang: zebra rib model remove grouping for ip route
Chirag Shah [Mon, 2 Mar 2020 15:22:45 +0000 (07:22 -0800)]
yang: zebra rib model remove grouping for ip route

Grouping is referencing leaves outside the grouping
from where it is used. Removing it and defining leaves
at the used place.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agozebra: convert clear evpn dup addr command to nb
Chirag Shah [Thu, 6 Feb 2020 21:32:34 +0000 (13:32 -0800)]
zebra: convert clear evpn dup addr command to nb

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agozebra: nb rpc cb for clear evpn dup addr cmd
Chirag Shah [Wed, 29 Jan 2020 20:05:35 +0000 (12:05 -0800)]
zebra: nb rpc cb for clear evpn dup addr cmd

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agozebra: clear dup detect cleanup for nb conversion
Chirag Shah [Thu, 6 Feb 2020 20:37:28 +0000 (12:37 -0800)]
zebra: clear dup detect cleanup for nb conversion

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agolib:api to convert mac to yang object
Chirag Shah [Thu, 30 Jan 2020 19:42:58 +0000 (11:42 -0800)]
lib:api to convert mac to yang object

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agozebra: nb callbacks support
Chirag Shah [Wed, 29 Jan 2020 17:38:03 +0000 (09:38 -0800)]
zebra: nb callbacks support

Definition of the northbound callbacks
and associated YANG data paths for zebra.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoyang: add zebra model in makefile
Chirag Shah [Fri, 13 Dec 2019 01:43:19 +0000 (17:43 -0800)]
yang: add zebra model in makefile

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years ago*: frr nexthop yang in makefile
Chirag Shah [Wed, 29 Jan 2020 17:38:03 +0000 (09:38 -0800)]
*: frr nexthop yang in makefile

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoyang: zebra rib operational model
Chirag Shah [Fri, 6 Dec 2019 02:48:14 +0000 (18:48 -0800)]
yang: zebra rib operational model

augment /frr-vrf:lib/frr-vrf:vrf:
  +--rw ribs
     +--rw rib* [afi-safi-name table-id]
        +--rw table-id         uint32
        +--rw afi-safi-name    identityref
        +--ro route* [prefix]
           +--ro prefix             ietf-inet-types:ip-prefix
           +--ro protocol?          frr-route-types:frr-route-types-v4
           +--ro protocol-v6?       frr-route-types:frr-route-types-v6
           +--ro vrf?               frr-vrf:vrf-ref
           +--ro distance?          uint8
           +--ro metric?            uint32
           +--ro tag?               uint32
           +--ro selected?          empty
           +--ro installed?         empty
           +--ro failed?            empty
           +--ro queued?            empty
           +--ro internal-flags?    int32
           +--ro internal-status?   int32
           +--ro uptime?            ietf-yang-types:date-and-time
           +--ro nexthop-group* [name]
              +--ro name            string
              +--ro frr-nexthops
                 +--ro nexthop* [nh-type gateway interface]
                    +--ro nh-type             frr-nexthop:nexthop-type
                    +--ro vrf?                frr-vrf:vrf-ref
                    +--ro gateway             frr-nexthop:optional-ip-address
                    +--ro interface           frr-interface:interface-ref
                    +--ro bh-type?            frr-nexthop:blackhole-type
                    +--ro onlink?             boolean <false>
                    +--ro mpls-label-stack
                    |  +--ro entry* [id]
                    |     +--ro id               uint8
                    |     +--ro label?           ietf-routing-types:mpls-label
                    |     +--ro ttl?             uint8
                    |     +--ro traffic-class?   uint8
                    +--ro duplicate?          empty
                    +--ro recursive?          empty
                    +--ro active?             empty
                    +--ro fib?                empty

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoyang: revert leafref to get interface cmd working
Chirag Shah [Sat, 21 Mar 2020 23:46:24 +0000 (16:46 -0700)]
yang: revert leafref to get interface cmd working

Unable to access interface command:
root@bharat:~/stash/libyang/build# dpkg-query -W | grep libyang
libyang-dev 0.16.105-3~ubuntu18.04.1
libyang0.16 0.16.105-3~ubuntu18.04.1
root@bharat:~/stash/libyang/build# vtysh
bharat# config t
bharat(config)# interface lo
% Configuration failed: validation error.

Please check the logs for more details.

Logfile:
2020/03/21 16:48:55 ZEBRA: libyang: Leafref
"/frr-vrf:lib/frr-vrf:vrf/frr-vrf:name" of value "default"
points to a non-existing leaf.
(/frr-interface:lib/interface[name='lo'][vrf='default']/vrf)
2020/03/21 16:48:55 ZEBRA: [EC 100663337]
nb_candidate_commit_prepare: failed to validate
candidate configuration

CI system failure:
2020/03/21 18:53:18 ZEBRA: libyang: Leafref
"/frr-vrf:lib/frr-vrf:vrf/frr-vrf:name" of value "default"
points to a non-existing leaf.
(/frr-interface:lib/interface[name='r1-eth0'][vrf='default']/vrf)
2020/03/21 18:53:18 ZEBRA: [EC 100663337] nb_candidate_commit_prepare:
failed to validate candidate configuration
2020/03/21 18:53:18 ZEBRA: libyang: Leafref
"/frr-vrf:lib/frr-vrf:vrf/frr-vrf:name" of value "default"
points to a non-existing leaf.
(/frr-interface:lib/interface[name='r1-eth1'][vrf='default']/vrf)

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agolib: convert vrf cmd to northbound config callback
Chirag Shah [Sat, 21 Mar 2020 21:35:14 +0000 (14:35 -0700)]
lib: convert vrf cmd to northbound config callback

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years ago*: include vrf northbound module in init
Chirag Shah [Wed, 11 Mar 2020 20:14:08 +0000 (13:14 -0700)]
*: include vrf northbound module in init

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agolib: vrf northbound callbacks
Chirag Shah [Wed, 11 Mar 2020 01:20:49 +0000 (18:20 -0700)]
lib: vrf northbound callbacks

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agolib: yang defination for basic frr-routing
vdhingra [Wed, 11 Dec 2019 05:57:37 +0000 (21:57 -0800)]
lib: yang defination for basic frr-routing

Yang files for basic frr-routing used by other
daemons like staticd and pim

Co-authored-by: Santosh P K <sapk@vmware.com>
Co-authored-by: vishaldhingra <vdhingra@vmware.com>
Signed-off-by: vishaldhingra <vdhingra@vmware.com>
4 years agoMerge pull request #5451 from opensourcerouting/rcu-log
Santosh P K [Thu, 16 Apr 2020 14:53:44 +0000 (20:23 +0530)]
Merge pull request #5451 from opensourcerouting/rcu-log

logging subsystem rewrite

4 years agostaticd: yang defination
vdhingra [Tue, 3 Dec 2019 14:00:51 +0000 (06:00 -0800)]
staticd: yang defination

Yang files for staticd to use northbound APIs

Co-authored-by: Santosh P K <sapk@vmware.com>
Co-authored-by: vishaldhingra <vdhingra@vmware.com>
Signed-off-by: vishaldhingra <vdhingra@vmware.com>
4 years agolib: FRR next-hop yang data model.
Santosh P K [Fri, 20 Dec 2019 08:30:57 +0000 (00:30 -0800)]
lib: FRR next-hop yang data model.

A common nexthop and group nexthop yang data model
for all protocols in FRR.

Co-authored-by: Santosh P K <sapk@vmware.com>
Co-authored-by: Vishaldhingra <vdhingra@vmware.com>
Signed-off-by: Santosh P K <sapk@vmware.com>
4 years agoyang: add vrf ref to interface model
Chirag Shah [Mon, 3 Feb 2020 21:31:32 +0000 (13:31 -0800)]
yang: add vrf ref to interface model

module: frr-interface
  +--rw lib
     +--rw interface* [name vrf]
        +--rw name           string
        +--rw vrf            frr-vrf:vrf-ref
        +--rw description?   string

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years ago*: add frr-vrf yang module in makefile
Chirag Shah [Mon, 9 Dec 2019 02:18:04 +0000 (18:18 -0800)]
*: add frr-vrf yang module in makefile

lib: Adding frr-vrf yang module to common place
so it can be accessed from all frr modules.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoyang: add vrf model
Chirag Shah [Fri, 6 Dec 2019 04:47:01 +0000 (20:47 -0800)]
yang: add vrf model

module: frr-vrf
  +--rw lib
     +--rw vrf* [name]
        +--rw name      string
        +--ro id?       uint32
        +--ro active?   boolean <false>
        +--rw netns {netns}?
           +--rw name?   string

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agobgpd: Add a sanitify check for bgp_nexthop_cache against NULL
Donatas Abraitis [Thu, 16 Apr 2020 13:13:01 +0000 (16:13 +0300)]
bgpd: Add a sanitify check for bgp_nexthop_cache against NULL

In real world sometimes happens that bgp_nexthop_cache is NULL. Avoid
segfaulting when using `show [ip] bgp ...` CLI commands.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #6238 from donaldsharp/test_evpn_vxlan_cleanup
Donatas Abraitis [Thu, 16 Apr 2020 13:05:34 +0000 (16:05 +0300)]
Merge pull request #6238 from donaldsharp/test_evpn_vxlan_cleanup

tests: Cleanup bgp config for evpn vxlan topotest

4 years agobgpd, lib: Use bool instead of uint8_t for community/prefix-list "any"
Donatas Abraitis [Thu, 16 Apr 2020 08:15:35 +0000 (11:15 +0300)]
bgpd, lib: Use bool instead of uint8_t for community/prefix-list "any"

That's only 0/1, useful to use just a bool for that.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agotests: Cleanup bgp config for evpn vxlan topotest
Donald Sharp [Thu, 16 Apr 2020 11:04:27 +0000 (07:04 -0400)]
tests: Cleanup bgp config for evpn vxlan topotest

The bgp configuration for the vxlan topotest mixed
and matched some configuration that does not belong
for an IBGP setup.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agolib: #define FRR_CMD_NODE_20200416
David Lamparter [Thu, 16 Apr 2020 10:55:02 +0000 (12:55 +0200)]
lib: #define FRR_CMD_NODE_20200416

... requested by Lou.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
4 years agovtysh: use parent_node for vtysh_exit()
David Lamparter [Thu, 2 Apr 2020 10:06:12 +0000 (12:06 +0200)]
vtysh: use parent_node for vtysh_exit()

Cleaning up the whole mess of "exit" and "quit" commands that follows is
left for a rainy day :(

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years ago*: add ->node_exit to struct cmd_node
David Lamparter [Sat, 8 Sep 2018 22:03:19 +0000 (00:03 +0200)]
*: add ->node_exit to struct cmd_node

Rather than doing a f*gly hack for the RPKI code, let's do an on-exit
hook in cmd_node.  Also allows replacing some special-casing in the vty
code.

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agozebra: fix FPM node reusing VTY_NODE
David Lamparter [Wed, 15 Apr 2020 10:26:01 +0000 (12:26 +0200)]
zebra: fix FPM node reusing VTY_NODE

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
4 years ago*: move CLI node names to cmd_node->name
David Lamparter [Sat, 8 Sep 2018 22:15:50 +0000 (00:15 +0200)]
*: move CLI node names to cmd_node->name

And again for the name.  Why on earth would we centralize this, just so
people can forget to update it?

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years ago*: move CLI parent data to cmd_node->parent_node
David Lamparter [Sat, 8 Sep 2018 21:15:09 +0000 (23:15 +0200)]
*: move CLI parent data to cmd_node->parent_node

Same as before, instead of shoving this into a big central list we can
just put the parent node in cmd_node.

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years ago*: remove second parameter on install_node()
David Lamparter [Sat, 8 Sep 2018 20:31:43 +0000 (22:31 +0200)]
*: remove second parameter on install_node()

There is really no reason to not put this in the cmd_node.

And while we're add it, rename from pointless ".func" to ".config_write".

[v2: fix forgotten ldpd config_write]

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years ago*: remove cmd_node->vtysh
David Lamparter [Sat, 8 Sep 2018 20:00:24 +0000 (22:00 +0200)]
*: remove cmd_node->vtysh

The only nodes that have this as 0 don't have a "->func" anyway, so the
entire thing is really just pointless.

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years ago*: clean up cmd_node initializers
David Lamparter [Sat, 8 Sep 2018 19:46:23 +0000 (21:46 +0200)]
*: clean up cmd_node initializers

... and use named assignments everywhere (so I can change the struct.)

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agoMerge pull request #6237 from ton31337/fix/show_hostname_in_bgp
Donald Sharp [Thu, 16 Apr 2020 10:45:42 +0000 (06:45 -0400)]
Merge pull request #6237 from ton31337/fix/show_hostname_in_bgp

bgpd: Show hostname in `show [ip] bgp ...` only if nexthop is connected

4 years agotests: Check if the right next-hop is shown (bgp_show_ip_bgp_fqdn)
Donatas Abraitis [Thu, 16 Apr 2020 07:37:21 +0000 (10:37 +0300)]
tests: Check if the right next-hop is shown (bgp_show_ip_bgp_fqdn)

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agobgpd: Show hostname in `show [ip] bgp ...` only if nexthop is connected
Donatas Abraitis [Thu, 16 Apr 2020 07:36:59 +0000 (10:36 +0300)]
bgpd: Show hostname in `show [ip] bgp ...` only if nexthop is connected

The problem is when using kinda such topologies:
(192.168.1.1/32) r1 <-- eBGP --> r2 <-- iBGP --> r3

Looking at r3's nexthop for 192.168.1.1/32 we have it as r2, but really
it MUST be r1.

Checking if the nexthop is connected solves the problem even for cases
when route-reflectors are used.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agodoc: Documentation for ipv6 nd ra-hop-limit command
Don Slice [Wed, 15 Apr 2020 18:52:33 +0000 (18:52 +0000)]
doc: Documentation for ipv6 nd ra-hop-limit command

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
4 years agoMerge pull request #6232 from ton31337/fix/validate_lcommunities
Donald Sharp [Wed, 15 Apr 2020 18:19:16 +0000 (14:19 -0400)]
Merge pull request #6232 from ton31337/fix/validate_lcommunities

bgpd: Validate all large communities if specified more per line

4 years agozebra: add ability to set hoplimit for IPv6 RAs
Don Slice [Wed, 15 Apr 2020 12:37:17 +0000 (12:37 +0000)]
zebra: add ability to set hoplimit for IPv6 RAs

Reported by testing agency that rfc 4861 section 6.2.1 states
that all implementations must have a configuration knob to change
the setting of the advertised hop limit.  This fix adds that
capability.

Ticket: CM-29200
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
4 years agoMerge pull request #6229 from donaldsharp/netlink_request_fixup
Rafael Zalamena [Wed, 15 Apr 2020 16:45:58 +0000 (13:45 -0300)]
Merge pull request #6229 from donaldsharp/netlink_request_fixup

zebra: Modify netlink_request to statisfy coverity

4 years agobgpd: Validate all large communities if specified more per line
Donatas Abraitis [Wed, 15 Apr 2020 15:21:24 +0000 (18:21 +0300)]
bgpd: Validate all large communities if specified more per line

```
(config)# bgp large-community-list standard FRR-1 permit 1:1:1:1
% Malformed community-list value
(config)# bgp large-community-list standard FRR-1 permit 1:1:1 1:2
% Malformed community-list value
(config)# bgp large-community-list standard FRR-1 permit 1:1:1 1:2 3:3:2
% Malformed community-list value
(config)# bgp large-community-list standard FRR-1 permit 1:1:1 1:2 3:3:2 0:0:0
% Malformed community-list value
(config)# bgp large-community-list standard FRR-1 permit 0:0:1231321231414
% Malformed community-list value
(config)# bgp large-community-list standard FRR-1 permit 1:1:1 1:2:3 3:3:2 0:0:
% Malformed community-list value
(config)# bgp large-community-list standard FRR-1 permit 1:1:1 1:2:3 3:3:2 0:2:3
(config)# bgp large-community-list standard FRR-1 permit 1:1:1 1:2:3 3:3:2
(config)#
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #6230 from donaldsharp/nhrp_json_silliness
Donatas Abraitis [Wed, 15 Apr 2020 15:06:38 +0000 (18:06 +0300)]
Merge pull request #6230 from donaldsharp/nhrp_json_silliness

nhrpd: Actually allow json output

4 years agoMerge pull request #6226 from LabNConsulting/ziemba/ldpd-fix-md5key-length
Renato Westphal [Wed, 15 Apr 2020 14:46:30 +0000 (11:46 -0300)]
Merge pull request #6226 from LabNConsulting/ziemba/ldpd-fix-md5key-length

ldpd: ldp_vty_neighbor_password(): fix auth.md5key_len calculation

4 years agonhrpd: Actually allow json output
Donald Sharp [Wed, 15 Apr 2020 13:25:54 +0000 (09:25 -0400)]
nhrpd: Actually allow json output

Add the correct pointer check to see if we should
be doing json output.

Discovered by SA.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agozebra: Modify netlink_request to statisfy coverity
Donald Sharp [Wed, 15 Apr 2020 12:56:03 +0000 (08:56 -0400)]
zebra: Modify netlink_request to statisfy coverity

The netlink_request function takes a `struct nlmsghdr *`
pointer from a common pattern that we use:

struct {
struct nlmsghdr n;
struct fib_rule_hdr frh;
char buf[NL_PKT_BUF_SIZE];
} req;

We were calling it `netlink_request(Socket, &req.n)`

The problem here is that coverity, rightly so, sees that
we access the data after the nlmsghdr in netlink_request and
tells us we have an read beyond end of the structure.  While
we know we haven't mangled anything up here because of manual
inspection coverity doesn't have this knowledge implicitly.

So let's modify the code call to netlink_request to pass in the
void pointer of the req structure itself, cast to the appropriate
data structure in the function and do the right thing.  Hopefully
the coverity SA will be happy and we can move on with our life.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #6154 from donaldsharp/check_interface_working
Renato Westphal [Wed, 15 Apr 2020 02:37:47 +0000 (23:37 -0300)]
Merge pull request #6154 from donaldsharp/check_interface_working

tests: Add a route-map test to ensure it accepts an unknown intf name

4 years agoldpd: ldp_vty_neighbor_password(): fix auth.md5key_len calculation
G. Paul Ziemba [Wed, 15 Apr 2020 02:08:57 +0000 (19:08 -0700)]
ldpd: ldp_vty_neighbor_password(): fix auth.md5key_len calculation

Per issue #6202

Very long passwords (>79 chars) get truncated: save truncated
length in nbrp->auth.md5key_len instead of original length.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
4 years agodoc: Add doc for `show bgp l2vpn evpn route type`
Trey Aspelund [Thu, 5 Mar 2020 00:24:51 +0000 (19:24 -0500)]
doc: Add doc for `show bgp l2vpn evpn route type`

Add documentation for this command and its RT filters.

Signed-off-by: Trey Aspelund <taspelund@cumulusnetworks.com>
4 years agobgpd: Add int args to `show bgp evpn route type`
Trey Aspelund [Tue, 10 Mar 2020 18:11:12 +0000 (14:11 -0400)]
bgpd: Add int args to `show bgp evpn route type`

This adds numeric keywords to 'show bgp l2vpn evpn route type'.

Signed-off-by: Trey Aspelund <taspelund@cumulusnetworks.com>
4 years agoMerge pull request #6225 from qlyoung/fix-zebra-counter-printf-specifiers
Renato Westphal [Wed, 15 Apr 2020 00:03:09 +0000 (21:03 -0300)]
Merge pull request #6225 from qlyoung/fix-zebra-counter-printf-specifiers

zebra: use %u for unsigned when printing counters

4 years agoMerge pull request #6214 from opensourcerouting/bfdd-debug
Donald Sharp [Tue, 14 Apr 2020 23:06:10 +0000 (19:06 -0400)]
Merge pull request #6214 from opensourcerouting/bfdd-debug

bfdd: code/logging/debug improvements

4 years agobgpd: Fix typos in `show bgp evpn route type`
Trey Aspelund [Tue, 10 Mar 2020 18:08:54 +0000 (14:08 -0400)]
bgpd: Fix typos in `show bgp evpn route type`

This fixes unnecessary whitespaces and makes capitalization
match for route type help strings.

Signed-off-by: Trey Aspelund <taspelund@cumulusnetworks.com>