]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
7 years agobgpd: "no neighbor 10.13.0.12 peer-group ibgp" does not remove peer 1757/head
Daniel Walton [Thu, 15 Feb 2018 20:55:43 +0000 (20:55 +0000)]
bgpd: "no neighbor 10.13.0.12 peer-group ibgp" does not remove peer

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
This worked for unnumbered peers but not for numbered peers. This is
before the fix:

router bgp 100
 coalesce-time 1000
 neighbor FOO peer-group
 neighbor FOO remote-as external
 neighbor swp1 interface peer-group FOO
 neighbor 1.1.1.1 peer-group FOO
!
line vty
 exec-timeout 0 0
!
end
cel-redxp-10# wr
Note: this version of vtysh never writes vtysh.conf
Building Configuration...
Integrated configuration saved to /etc/frr/frr.conf
[OK]
cel-redxp-10# conf t
cel-redxp-10(config)# router bgp
cel-redxp-10(config-router)# no neighbor swp1 interface peer-group FOO
cel-redxp-10(config-router)# no neighbor 1.1.1.1 peer-group FOO
cel-redxp-10(config-router)# do show run
Building configuration...

Current configuration:
!
frr version 4.1-dev
frr defaults datacenter
hostname cel-redxp-10
!
service integrated-vtysh-config
!
password cn321
!
log syslog
!
router bgp 100
 coalesce-time 1000
 neighbor FOO peer-group
 neighbor FOO remote-as external
 neighbor 1.1.1.1 remote-as external
 !
 address-family ipv4 unicast
  no neighbor 1.1.1.1 activate
 exit-address-family
!
line vty
 exec-timeout 0 0
!
end
cel-redxp-10(config-router)#

After the fix "no neighbor 1.1.1.1 peer-group FOO" removes the 1.1.1.1
neighbor.

7 years agoMerge pull request #1738 from chiragshah6/ospfv3_dev
Olivier Dugeon [Thu, 15 Feb 2018 16:17:38 +0000 (17:17 +0100)]
Merge pull request #1738 from chiragshah6/ospfv3_dev

ospf6d: Handle Premature Aging of LSAs

7 years agoospf6d: Handle Premature Aging of LSAs 1738/head
Chirag Shah [Fri, 26 Jan 2018 22:53:43 +0000 (14:53 -0800)]
ospf6d: Handle Premature Aging of LSAs

RFC 2328 (14.1) Premature aging of LSAs from
routing domain :
When ospf6d is going away (router going down),
send MAXAGEd self originated LSAs to all
neighbors in routing domain to trigger
Premature aging to remove from resepective LSDBs.

Neighbor Router Reboot:
Upon receiving Self-originate MAXAGEd LSA, simply
discard, Current copy could be non maxaged latest.

For neighbor advertised LSA's (current copy in LSDB)
is set to MAXAGE but received new LSA with Non-MAXAGE
(with current age), discard the current MAXAGE LSA,
Send latest copy of LSA to neighbors and update the
LSDB with new LSA.

When a neighbor transition to FULL, trigger AS-External
LSAs update from external LSDB to new neighbor.

Testing:
R1 ---- DUT --- R5
| \
R2 R3
|
R4

Area 1: R5 and DUT
Area 0: DUT, R1, R2, R3
Area 2: R2 R4

Add IPv6 static routes at R5
Redistribute kernel routes at R5,
Validate routes at R4, redistributed via backbone
to area 2.
Stop n start frr.service at R5 and validated
MAXAGE LSAs then recent age LSAs in Database at DUT-R4.
Validated external routes installed DUT to R4.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
7 years agoisisd: Free up some memory allocated.
Donald Sharp [Sat, 10 Feb 2018 19:03:09 +0000 (14:03 -0500)]
isisd: Free up some memory allocated.

The v4 and v6 prefixes were created but not deleted on
shutdown properly.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit 25b1001dc9c46bbfcb9e1af8231e0fa63a7d3bd3)
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
7 years agoMerge pull request #1701 from donaldsharp/zapi_vrf_label
Martin Winter [Wed, 14 Feb 2018 03:05:42 +0000 (19:05 -0800)]
Merge pull request #1701 from donaldsharp/zapi_vrf_label

Zapi vrf label

7 years agoMerge pull request #1734 from donaldsharp/control_me
Martin Winter [Tue, 13 Feb 2018 16:49:55 +0000 (08:49 -0800)]
Merge pull request #1734 from donaldsharp/control_me

debianpkg: Update build dependencies to say we don't co-exist with qu…

7 years agoMerge pull request #1683 from donaldsharp/doc_debian
Martin Winter [Tue, 13 Feb 2018 16:39:39 +0000 (08:39 -0800)]
Merge pull request #1683 from donaldsharp/doc_debian

doc: Fix Debian 9 build instructions

7 years agoMerge pull request #1735 from LabNConsulting/working/master/pre-vpn-vrf-leak-indenting
Donald Sharp [Sat, 10 Feb 2018 14:24:40 +0000 (09:24 -0500)]
Merge pull request #1735 from LabNConsulting/working/master/pre-vpn-vrf-leak-indenting

Working/master/pre vpn vrf leak indenting

7 years agoMerge pull request #1737 from mkanjari/build-failure
Donald Sharp [Sat, 10 Feb 2018 01:53:03 +0000 (20:53 -0500)]
Merge pull request #1737 from mkanjari/build-failure

zebra: fix build breakage

7 years agozebra: fix build breakage 1737/head
mitesh [Sat, 10 Feb 2018 00:57:37 +0000 (16:57 -0800)]
zebra: fix build breakage

is_vni_l3 was removed as a part of PR1700. However, it seems to be used in master.
Causing the breakage. Made the changes to not use the API anymore.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
7 years agoMerge pull request #1719 from donaldsharp/rip_split_fuckery
Renato Westphal [Sat, 10 Feb 2018 00:07:02 +0000 (22:07 -0200)]
Merge pull request #1719 from donaldsharp/rip_split_fuckery

ripd: Fix crash when ip rip split-horizon poisoned-reverse is configed

7 years agoMerge pull request #1731 from donaldsharp/zebra_stuff
Renato Westphal [Sat, 10 Feb 2018 00:01:12 +0000 (22:01 -0200)]
Merge pull request #1731 from donaldsharp/zebra_stuff

zebra: sharp protocol needs a default admin distance.

7 years agoMerge pull request #1700 from mkanjari/evpn-symm-routing-enhancements-2.0
Renato Westphal [Fri, 9 Feb 2018 23:20:27 +0000 (21:20 -0200)]
Merge pull request #1700 from mkanjari/evpn-symm-routing-enhancements-2.0

EVPN Symmetric routing enhancements 2.0

7 years agoMerge pull request #1722 from donaldsharp/vrf_mc_vrf
Renato Westphal [Fri, 9 Feb 2018 22:54:17 +0000 (20:54 -0200)]
Merge pull request #1722 from donaldsharp/vrf_mc_vrf

zebra: Fix vrf routes from assuming their nh's were in the default

7 years agowhitespace/comment fixes per qlyoung 1735/head
G. Paul Ziemba [Fri, 9 Feb 2018 21:14:22 +0000 (13:14 -0800)]
whitespace/comment fixes per qlyoung

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
7 years agobgpd: ran indent.py on some files prior to bgp vpn-vrf leaking changes
G. Paul Ziemba [Fri, 9 Feb 2018 18:22:50 +0000 (10:22 -0800)]
bgpd: ran indent.py on some files prior to bgp vpn-vrf leaking changes

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
7 years agoalso protect ALIAS from indenting
G. Paul Ziemba [Fri, 9 Feb 2018 18:18:35 +0000 (10:18 -0800)]
also protect ALIAS from indenting

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
7 years agoMerge branch 'working/master/json-bgp-vpn-fixes' of https://github.com/LabNConsulting... 1733/head
G. Paul Ziemba [Fri, 9 Feb 2018 17:40:25 +0000 (09:40 -0800)]
Merge branch 'working/master/json-bgp-vpn-fixes' of https://github.com/LabNConsulting/frr into working/master/json-bgp-vpn-fixes

7 years agobgpd: json route table brace counting
G. Paul Ziemba [Fri, 9 Feb 2018 17:29:39 +0000 (09:29 -0800)]
bgpd: json route table brace counting

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
7 years agobgpd: json route table brace counting
G. Paul Ziemba [Fri, 9 Feb 2018 17:29:39 +0000 (09:29 -0800)]
bgpd: json route table brace counting

7 years agozebra: Use appropriate output function for label printing 1701/head
Donald Sharp [Fri, 9 Feb 2018 00:51:37 +0000 (19:51 -0500)]
zebra: Use appropriate output function for label printing

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd, lib, sharpd, zebra: Use MPLS_LABEL_NONE
Donald Sharp [Thu, 8 Feb 2018 15:19:34 +0000 (10:19 -0500)]
bgpd, lib, sharpd, zebra: Use MPLS_LABEL_NONE

Modify mpls.h to rename MPLS_LABEL_ILLEGAL to be MPLS_LABEL_NONE.
Fix all pre-existing code that used MPLS_LABEL_ILLEGAL.

Modify the zapi vrf label message to use MPLS_LABEL_NONE as the
signal to remove label associated with a vrf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib, sharpd, zebra: Add new enum for lsp type and pass it through.
Donald Sharp [Thu, 8 Feb 2018 14:50:32 +0000 (09:50 -0500)]
lib, sharpd, zebra: Add new enum for lsp type and pass it through.

Add the ability to pass the lsp owner type through the zapi
and in addition add a new label type for the sharp protocol
for testing.

Finally modify zebra_mpls.h to not have defaults specified
for the enum.  That way when we add a new LSP type the
compile fails and the person doing the addition knows
where he has to touch shit.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years ago*: Make code use a consisten definition of labels
Donald Sharp [Wed, 31 Jan 2018 23:24:06 +0000 (18:24 -0500)]
*: Make code use a consisten definition of labels

Turns out we had 3 different ways to define labels
all of them overlapping with the same meanings.
Consolidate to 1.  This one choosen is consistent
naming wise with what the *bsd and linux kernels
use.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra: Cleanup mpls handling to allow a NEXTHOP_TYPE_IFINDEX
Donald Sharp [Wed, 31 Jan 2018 21:29:24 +0000 (16:29 -0500)]
zebra: Cleanup mpls handling to allow a NEXTHOP_TYPE_IFINDEX

Add the ability for the nexthops to be a NEXTHOP_TYPE_IFINDEX.
Since we are using this code for L3vpn pop and forward operations
and we know that the lo or vrf device name must exist we
trust that it is correct.

Update display to show the correct data with a 'show mpls table'

Update the mpls install into the kernel to treat
NEXTHOP_TYPE_IFINDEX as special and we do not need
to pass in the nexthop label.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agosharpd: Consolidate commands under 'sharp' keyword
Donald Sharp [Tue, 30 Jan 2018 18:59:51 +0000 (13:59 -0500)]
sharpd: Consolidate commands under 'sharp' keyword

The commands if not careful needed a way to isolate
themselves from each other and 'real' system commands
so let's put them under the sharp keyword.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agosharpd: Add some infrastructure to allow test of ZEBRA_VRF_LABEL
Donald Sharp [Tue, 30 Jan 2018 18:54:38 +0000 (13:54 -0500)]
sharpd: Add some infrastructure to allow test of ZEBRA_VRF_LABEL

Add some infrastructure to allow the testing of ZEBRA_VRF_LABEL

Signed-off-by: Donald Sharp <sharp@cumulusnetworks.com>
7 years agolib, zebra: Add new api to specify a label associated with the vrf
Donald Sharp [Tue, 30 Jan 2018 18:30:36 +0000 (13:30 -0500)]
lib, zebra: Add new api to specify a label associated with the vrf

For L3VPN's we need to create a label associated with the specified
vrf to be installed into the kernel to allow a pop and lookup
operation.

The new api is:
zclient_send_vrf_label(struct zclient *zclient, vrf_id_t vrf_id,
                       mpls_label_t label);

For the specified vrf_id associate the specified label for
a pop and lookup operation for forwarding.

To setup a POP and Forward use MPLS_LABEL_IMPLICIT_NULL
If the same label is passed in we ignore the call.
If the label is different we update entry.
If the label is MPLS_LABEL_NONE we remove
the entry.

This sets up the api.  Future commits will have the functionality
to actually install into the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib, zebra: Move nh_resolve_via_default to appropriate header
Donald Sharp [Wed, 24 Jan 2018 20:35:37 +0000 (15:35 -0500)]
lib, zebra: Move nh_resolve_via_default to appropriate header

The nh_resolve_via_default function is an accessor function
for NHT in zebra.  Let's move this function to it's proper
place.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years ago*: Track vrfs per nexthop not per route entry
Donald Sharp [Thu, 8 Feb 2018 14:12:12 +0000 (09:12 -0500)]
*: Track vrfs per nexthop not per route entry

Track the vfrs on a per nexthop basis instead
of on a per route entry basis.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra: sharp protocol needs a default admin distance. 1731/head
Donald Sharp [Fri, 9 Feb 2018 00:30:34 +0000 (19:30 -0500)]
zebra: sharp protocol needs a default admin distance.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #1720 from qlyoung/gitignore-changelog
Jafar Al-Gharaibeh [Thu, 8 Feb 2018 20:32:29 +0000 (14:32 -0600)]
Merge pull request #1720 from qlyoung/gitignore-changelog

debianpkg: .gitignore += changelog

7 years agodebianpkg: Update build dependencies to say we don't co-exist with quagga 1734/head
Donald Sharp [Thu, 8 Feb 2018 18:51:04 +0000 (13:51 -0500)]
debianpkg: Update build dependencies to say we don't co-exist with quagga

The control files for all build platforms are not consistent.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #1654 from mkanjari/evpn-symm-routing-enhancements
Philippe Guibert [Thu, 8 Feb 2018 10:46:29 +0000 (11:46 +0100)]
Merge pull request #1654 from mkanjari/evpn-symm-routing-enhancements

Evpn symmetric routing enhancements

7 years agozebra: Fix vrf routes from assuming their nh's were in the default 1722/head
Donald Sharp [Wed, 7 Feb 2018 23:22:15 +0000 (18:22 -0500)]
zebra: Fix vrf routes from assuming their nh's were in the default

Fix the read in of vrf routes on a start or restart that caused
the nexthop_vrf to be assumed to be the default vrf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #1721 from opensourcerouting/isis-monitor-fds
Donald Sharp [Wed, 7 Feb 2018 19:35:08 +0000 (14:35 -0500)]
Merge pull request #1721 from opensourcerouting/isis-monitor-fds

isis: use descriptor polling instead of time

7 years agoisis: use descriptor polling instead of time 1721/head
Rafael Zalamena [Wed, 7 Feb 2018 18:26:25 +0000 (16:26 -0200)]
isis: use descriptor polling instead of time

Allow other supported Operating Systems (OS) to use file descriptor
polling, instead of doing timed fd checks. This should improve
performance greatly on modern OSes (e.g. that support polling on
filtered sockets).

The known OS that doesn't support this is FreeBSD < 5.0, but even then
FRR doesn't compile in these versions. OSes using DLPI method (e.g
Solaris) does not support select()/poll()ing fds as well, so it will be
disabled for it.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
7 years agodebianpkg: .gitignore += changelog 1720/head
Quentin Young [Wed, 7 Feb 2018 18:13:46 +0000 (13:13 -0500)]
debianpkg: .gitignore += changelog

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #1718 from ak503/keychain
Donald Sharp [Wed, 7 Feb 2018 14:56:42 +0000 (09:56 -0500)]
Merge pull request #1718 from ak503/keychain

lib: 'no accept-lifetime' and 'no send-lifetime' for keychain

7 years agolib: 'no accept-lifetime' and 'no send-lifetime' for keychain 1718/head
dturlupov [Wed, 7 Feb 2018 11:56:06 +0000 (14:56 +0300)]
lib: 'no accept-lifetime' and 'no send-lifetime' for keychain

Signed-off-by: Dmitrii Turlupov <dturlupov@factor-rs.ru>
7 years agoripd: Fix crash when ip rip split-horizon poisoned-reverse is configed 1719/head
Donald Sharp [Tue, 6 Feb 2018 23:48:09 +0000 (18:48 -0500)]
ripd: Fix crash when ip rip split-horizon poisoned-reverse is configed

The code was attempting to access a variable that would always be NULL.
In fact this code has been broken since the rip ECMP changes
were put into place a few years back.

I'm going to come straight out and say that I don't fully
understand this code.  rinfo is the first item in the ecmp
list and tmp_rinfo is used to iterate over all the items
in the ecmp list.  It sure looks like that the changes
made here were just hacked together.  So I modified
the tmp_rinfo loop to just work on tmp_rinfo and
the check that was crashing I modified to just use
the rinfo since that what was checked originally
in code before the ECMP was added.  So consider
this a hack job to stop the crashing.

I think worse case is that we might be sending some routes
back out interfaces it shouldn't be if you have
ip rip split-horizon poisoned-reverse configured but
that is less bad(tm) than crashing.

Fixes: #1717
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #1712 from donaldsharp/nht_updates
Renato Westphal [Wed, 7 Feb 2018 01:34:12 +0000 (23:34 -0200)]
Merge pull request #1712 from donaldsharp/nht_updates

Nht updates

7 years agoMerge pull request #1677 from chiragshah6/ospfv3_dev
Jafar Al-Gharaibeh [Tue, 6 Feb 2018 20:33:10 +0000 (14:33 -0600)]
Merge pull request #1677 from chiragshah6/ospfv3_dev

ospf6d: Fix redistribute [connected] with route-map

7 years agoMerge pull request #1699 from silasm/debianpkg-fix-debian-rules
Martin Winter [Tue, 6 Feb 2018 19:10:12 +0000 (11:10 -0800)]
Merge pull request #1699 from silasm/debianpkg-fix-debian-rules

debianpkg: normalize rules files, simplify logic/editing with '?='

7 years agoconfigure: Update version to 4.1-dev
Donald Sharp [Tue, 6 Feb 2018 17:26:47 +0000 (12:26 -0500)]
configure: Update version to 4.1-dev

We are now working on 4.1-dev for new work.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #1542 from qlyoung/stylechecker
Martin Winter [Tue, 6 Feb 2018 16:44:37 +0000 (08:44 -0800)]
Merge pull request #1542 from qlyoung/stylechecker

tools: add style checking scripts

7 years agoMerge pull request #1653 from Orange-OpenSource/SR-Routing
Donald Sharp [Tue, 6 Feb 2018 16:32:51 +0000 (11:32 -0500)]
Merge pull request #1653 from Orange-OpenSource/SR-Routing

OSPFD: Add Experimental Segment Routing support

7 years agozebra: fix SA issues 1700/head
mitesh [Tue, 6 Feb 2018 00:21:00 +0000 (16:21 -0800)]
zebra: fix SA issues

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
7 years agoMerge pull request #1713 from donaldsharp/nexthop_vrfs
Renato Westphal [Mon, 5 Feb 2018 22:45:50 +0000 (20:45 -0200)]
Merge pull request #1713 from donaldsharp/nexthop_vrfs

lib: Fix encoding of vrf

7 years agoMerge pull request #1702 from donaldsharp/bgp_cleanup
Lou Berger [Mon, 5 Feb 2018 22:06:08 +0000 (16:06 -0600)]
Merge pull request #1702 from donaldsharp/bgp_cleanup

Bgp cleanup

7 years agoMerge pull request #1694 from qlyoung/fix-bgp-default-shutdown-conf-write
Lou Berger [Mon, 5 Feb 2018 22:04:08 +0000 (16:04 -0600)]
Merge pull request #1694 from qlyoung/fix-bgp-default-shutdown-conf-write

bgpd: fixup default shutdown

7 years agobgpd: match evpn route type command should use '<>' instead of '{}'
mitesh [Mon, 5 Feb 2018 21:56:12 +0000 (13:56 -0800)]
bgpd: match evpn route type command should use '<>' instead of '{}'

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
7 years agozebra: fix SA issues
mitesh [Mon, 5 Feb 2018 21:51:45 +0000 (13:51 -0800)]
zebra: fix SA issues

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
7 years agobgpd: allow evpn safi under vrf instance 1654/head
mitesh [Mon, 5 Feb 2018 21:29:52 +0000 (13:29 -0800)]
bgpd: allow evpn safi under vrf instance

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
7 years agobgpd: use BGP_LABEL_BYTES instead of a mogic number '3'
mitesh [Mon, 5 Feb 2018 21:24:57 +0000 (13:24 -0800)]
bgpd: use BGP_LABEL_BYTES instead of a mogic number '3'

While processing the type-2 evpn route nlri,
increment the pointer by BGP_LABEL_BYTES instead of '3'

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
7 years agoOSPFd: Fix Opaque LSA filtering in Segment Routing 1653/head
Olivier Dugeon [Mon, 5 Feb 2018 19:24:17 +0000 (20:24 +0100)]
OSPFd: Fix Opaque LSA filtering in Segment Routing

Opaque LSA were incorrectly filtered. LSA Type 1 with a
router id set to 4.x.x.x or 7.x.x.x. or 8.x.x.x are not correctly
filtered and pass to Segment Routing as wrong Opaque LSA of type
Router Information, Extended Prefix respectively Extended Link.
 - Add Opaque LSA check to the filter

The CLI command 'segment-routing prefix' didn't check if a same prefix
already exist in SRDB resulting to multiple entries in the SRDB for the
same prefix.
 - Update prefix intead of adding a new one if already present in the SRDB

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
7 years agobgpd, pimd: Handle return code for nexthop_decode 1712/head
Donald Sharp [Mon, 5 Feb 2018 13:34:47 +0000 (08:34 -0500)]
bgpd, pimd: Handle return code for nexthop_decode

Appropriately handle the return code for the
zapi_nexthop_update_decode call.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib: Fix encoding of vrf 1713/head
Donald Sharp [Mon, 5 Feb 2018 10:49:27 +0000 (05:49 -0500)]
lib: Fix encoding of vrf

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd, lib, pimd: Make nexthop_update decoding common
Donald Sharp [Mon, 5 Feb 2018 08:44:29 +0000 (03:44 -0500)]
bgpd, lib, pimd: Make nexthop_update decoding common

Create a zapi_nexthop_update_decode function that both
pim and bgp use to decode the message from zebra.

There probably could be further optimizations but I opted
to keep the code as similiar as is possible between the
originals because they both make some assumptions about
code flow that I do not fully understand yet.

The real goal here is that I want to create a new
user of the nexthop tracking code from a higher level
daemon and I see no need to re-implement this damn
code again for a 3rd time.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra: Cleanup nexthop update encoding
Donald Sharp [Mon, 5 Feb 2018 08:42:09 +0000 (03:42 -0500)]
zebra: Cleanup nexthop update encoding

The encoding of the nexthop update made some distinctions
between nexthop types that it does not need to.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoOSPFd: Fix ospfd crash during CI
Olivier Dugeon [Sat, 3 Feb 2018 18:30:33 +0000 (19:30 +0100)]
OSPFd: Fix ospfd crash during CI

When preforming CI test, CLI command 'no router ospf' followed by a
'router ospf' is performed to clean up the previous configuration.
Ospfd crash when configuring 'netwoark area'.

This is due to opsf_opaque_term() introduce in previous commit that cause this
crash. It remove not only Opaque LSA but also the list through the call to
'list_delete_and_null()' function. Same take place in 'ospf_mpls_te_term()',
'ospf_router_info_term()' and 'ospf_ext_term()' function.

New set of 'ospf_XXX_finish()' has been introduced to solve this issue while
keeping the possiblity to terminate properly the Opaque LSA and remove MPLS
LFIB entries set by Segment Routing.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
7 years agobgpd: Fix some evpn hash key creation 1702/head
Donald Sharp [Fri, 12 Jan 2018 14:55:28 +0000 (09:55 -0500)]
bgpd: Fix some evpn hash key creation

The creation of a hash key should use a jhash
function instead of adding the char's together.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: Fix bgp_vty.h to conform to coding standard
Donald Sharp [Fri, 12 Jan 2018 14:51:18 +0000 (09:51 -0500)]
bgpd: Fix bgp_vty.h to conform to coding standard

The function declarations were missing some parameter
names as is our standard.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: bgp_afi_node_get is listed 2 times in bgp_route.h
Donald Sharp [Wed, 10 Jan 2018 20:07:05 +0000 (15:07 -0500)]
bgpd: bgp_afi_node_get is listed 2 times in bgp_route.h

Remove the extra.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #1695 from chiragshah6/mdev
Renato Westphal [Sat, 3 Feb 2018 14:18:48 +0000 (12:18 -0200)]
Merge pull request #1695 from chiragshah6/mdev

ospfd: fix default-information orignate command not to display default parameter

7 years agoMerge pull request #1705 from donaldsharp/martian_nexthop
Renato Westphal [Sat, 3 Feb 2018 14:10:30 +0000 (12:10 -0200)]
Merge pull request #1705 from donaldsharp/martian_nexthop

bgpd: Add ability to see martian next-hop's for a vrf

7 years agobgpd: Add ability to see martian next-hop's for a vrf 1705/head
Donald Sharp [Sat, 3 Feb 2018 00:26:22 +0000 (19:26 -0500)]
bgpd: Add ability to see martian next-hop's for a vrf

We've run across an issue where the local connected
ip address is not being removed in some error condition.
During trackdown it was noticed that we cannot look
at this table for views/vrf's.  While we don't have the
bug tracked down yet this will help us figure it out.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #1703 from opensourcerouting/bsd-warnings
Donald Sharp [Fri, 2 Feb 2018 19:36:42 +0000 (14:36 -0500)]
Merge pull request #1703 from opensourcerouting/bsd-warnings

BSD warnings

7 years agolib: fix more warnings on *BSD 1703/head
Renato Westphal [Fri, 2 Feb 2018 01:18:46 +0000 (23:18 -0200)]
lib: fix more warnings on *BSD

* zebra/kernel_socket.c: include "rt.h" to provide the prototypes of
  kernel_init() and kernel_terminate();

* lib/prefix.h: remove the deprecation warning whenever ETHER_ADDR_LEN
  is used. isisd uses the ETHER_HDR_LEN constant which is defined in
  terms of ETHER_ADDR_LEN in the *BSD system headers. So, when building
  FRR on *BSD, we were getting several warnings because we were using
  ETHER_ADDR_LEN indirectly;

* lib/command_lex.l, lib/defun_lex.l: ignore other harmless warnings;

* lib/spf_backoff.c: cast 'tv->tv_usec' to 'long int' before printing.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years ago*: silence '-Wchar-subscripts' warnings on NetBSD
Renato Westphal [Fri, 2 Feb 2018 17:11:03 +0000 (15:11 -0200)]
*: silence '-Wchar-subscripts' warnings on NetBSD

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years ago*: silence '-Wmaybe-uninitialized' warnings on NetBSD
Renato Westphal [Fri, 2 Feb 2018 17:10:09 +0000 (15:10 -0200)]
*: silence '-Wmaybe-uninitialized' warnings on NetBSD

None of these variables can actually be used before being initialized,
but unfortunately some old compilers are not smart enough to detect that.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agotests: fix warnings related to afi/safi constants
Renato Westphal [Thu, 1 Feb 2018 23:04:03 +0000 (21:04 -0200)]
tests: fix warnings related to afi/safi constants

We were improperly mixing constants used to identify AFI/SAFI values
using the IANA and internal representations. Things happened to be
working because the IANA/internal values are the same in some cases
(e.g. AFI_IP and IANA_AFI_IPV4). This commit fixes a few warnings when
running "make check" on FreeBSD 11.1.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agotests: fix warnings by removing dead code
Renato Westphal [Thu, 1 Feb 2018 22:59:08 +0000 (20:59 -0200)]
tests: fix warnings by removing dead code

These variables being removed were made obsolete by commit 9cabb64b3. As
of now, the parse_test() function fetches the afi/safi values from
the parsed NLRIs. There's no need to have duplicate information in the
'test_segment' structure anymore.

This fixes several warnings of this kind when running "make check"
on FreeBSD: "implicit conversion from enumeration type 'iana_safi_t'
to different enumeration type 'safi_t'".

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoMerge pull request #1696 from donaldsharp/pim_node_removal
Rafael Zalamena [Fri, 2 Feb 2018 13:12:15 +0000 (11:12 -0200)]
Merge pull request #1696 from donaldsharp/pim_node_removal

lib, pimd: Remove PIM_NODE as it is not needed

7 years agoMerge pull request #1687 from donaldsharp/dest
Rafael Zalamena [Fri, 2 Feb 2018 13:08:28 +0000 (11:08 -0200)]
Merge pull request #1687 from donaldsharp/dest

zebra: Fix crash when dereferencing dest->selected_fib

7 years agoOSPFd: Correct Extended Prefix LSA refresh
Olivier Dugeon [Thu, 1 Feb 2018 13:30:34 +0000 (14:30 +0100)]
OSPFd: Correct Extended Prefix LSA refresh

 - When Extended Prefix LSA need to be refresh, paramaters may be
taken from the wrong interface i.e. Extended Link instead of Prefix
resulting in producing an empty LSA body. Then, ospfd crash due to the
assert on LSA length in ospf_lsa_different() function: code check that
the LSA size is larger than LSA header i.e. LSA is not empty.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
7 years agodebianpkg rules files: WANT_CUMULUS_MODE, not WANT_CUMULUS_NODE 1699/head
smccroskey [Thu, 1 Feb 2018 01:15:36 +0000 (17:15 -0800)]
debianpkg rules files: WANT_CUMULUS_MODE, not WANT_CUMULUS_NODE

variable name seemed strange, and previously-commented-out name
suggests it was a typo, remove the newly-added definitions and
fix the ifeq block to reference the intended name.

Signed-off-by: Silas McCroskey <smccroskey@cumulusnetworks.com>
7 years agodebianpkg rules files: bgp-vnc is enabled by default
smccroskey [Thu, 1 Feb 2018 01:10:44 +0000 (17:10 -0800)]
debianpkg rules files: bgp-vnc is enabled by default

9782a8db773b8c5d9094eb3743aae43cc04e12f0 went with the wrong source of
truth when comments and code disagreed over whether bgp-vnc should be
enabled by default.  Fix the behavior back to what it was before.

Signed-off-by: Silas McCroskey <smccroskey@cumulusnetworks.com>
7 years agodebianpkg: normalize rules files
smccroskey [Wed, 31 Jan 2018 01:00:48 +0000 (17:00 -0800)]
debianpkg: normalize rules files

downstream packagers prefer to change defaults in a trackable way by
changing the rules file directly, rather than setting environment
variables.  Use '?=' (set if not already set in the environment or on
the make cmdline) to set defaults rather than alternating between
ifeq/ifneq clauses, which is harder to follow and edit.  Change any
existing `ifneq(...,0)' cases to `ifeq(...,1)', and get rid of any
ifdef/ifndefs, as ?= guarantees he value will be defined in one way or
another.  This allows the old behavior of overriding via the
environment while simplifying the workflow for anyone editing or
extending the current logic and defaults.

Portability note about '?=': it is GNU-make specific, but so is
ifeq/ifneq, which is/was used in this file, and this file is specific
to debian-based system as it is, so I don't consider it to be a
problem in this case.

Added any missing defaults (WANT_SNMP, WANT_CUMULUS_NODE) and
made it so that USE_XXX is always set for the sake of consistency.
Also brought a few changes from base debianpkg/rules into the
backports versions of the files where they were missing.

Signed-off-by: Silas McCroskey <smccroskey@cumulusnetworks.com>
7 years agoMerge pull request #1693 from donaldsharp/v6_leaking
Renato Westphal [Wed, 31 Jan 2018 17:52:01 +0000 (15:52 -0200)]
Merge pull request #1693 from donaldsharp/v6_leaking

zebra: Fix v6 nexthop-vrf and nexthop confusion

7 years agoospfd: fix redistribute running config 1695/head
Chirag Shah [Tue, 30 Jan 2018 15:42:28 +0000 (07:42 -0800)]
ospfd: fix redistribute running config

Testing:
CL(config)# router ospf
CL(config-router)# redistribute static metric-type 2
CL(config)# router ospf
CL(config-router)# default-information originate always metric-type 2

show running output
router ospf
 redistribute static
 default-information originate always
!

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
7 years agobgpd: improve default shutdown help string 1694/head
Quentin Young [Tue, 30 Jan 2018 16:47:15 +0000 (11:47 -0500)]
bgpd: improve default shutdown help string

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #1690 from dslicenc/bgpd-vrf-show-cm17377
Lou Berger [Tue, 30 Jan 2018 16:42:26 +0000 (11:42 -0500)]
Merge pull request #1690 from dslicenc/bgpd-vrf-show-cm17377

bgpd: fix output of show bgp vrf all neighbor x.x.x.x

7 years agotools: return exit status in checkpatch.sh 1542/head
Quentin Young [Tue, 30 Jan 2018 15:48:03 +0000 (10:48 -0500)]
tools: return exit status in checkpatch.sh

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoOSPFd: Clean up Segment Routing patch
Olivier Dugeon [Tue, 30 Jan 2018 15:17:54 +0000 (16:17 +0100)]
OSPFd: Clean up Segment Routing patch

 - ospfd/ospf_te.c: Remove unregister function and call to
ospf_delete_opaque_functab() following the introduction of
ospf_opaque_term() function in ospfd.c for ospfd termination.
 - ospfd/ospf_sr.c: Set initial index value for node-msd CLI to
avaoid crash when using this command
 - ospfd/ospf_ext.c: Disable call to ospf_sr_update_prefix() if
Segment Routing, thus Extended Link/Prefix, is not enable
 - ospfd/ospf_opaque.c: Correct scheduling of Opaque LSA flooding

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
7 years agobgpd: fixup default shutdown
Quentin Young [Tue, 30 Jan 2018 15:12:19 +0000 (10:12 -0500)]
bgpd: fixup default shutdown

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoOSPFd: Remove unecessary debug message
Olivier Dugeon [Tue, 30 Jan 2018 13:25:40 +0000 (14:25 +0100)]
OSPFd: Remove unecessary debug message

 - Line 865 in ospfd/ospf_ext.c cause compilation failure when
-werror is set. This line was not necessary and add only for debugging
purpose.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
7 years agobgpd: fix output of show bgp vrf all neighbor x.x.x.x 1690/head
Don Slice [Thu, 25 Jan 2018 16:06:27 +0000 (16:06 +0000)]
bgpd: fix output of show bgp vrf all neighbor x.x.x.x

Problem reported with output of the command "show bgp vrf all
neighbor x.x.x.x" not limiting the output to that peer in any vrf.
This fix corrects the logic to display by neighbor
(ipv4/ipv6/interface) in any vrf.

Ticket: CM-17377
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
7 years agoMerge remote-tracking 'frr/master' into SR-Routing
Olivier Dugeon [Tue, 30 Jan 2018 10:43:25 +0000 (11:43 +0100)]
Merge remote-tracking 'frr/master' into SR-Routing

7 years agoOSPFd: Correct compilation error
Olivier Dugeon [Tue, 30 Jan 2018 10:42:02 +0000 (11:42 +0100)]
OSPFd: Correct compilation error

 - Forget to remove ospf_router_info_unregister in ospfd_ri.c

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
7 years agoMerge pull request #1688 from chiragshah6/mdev
Olivier Dugeon [Tue, 30 Jan 2018 10:37:59 +0000 (11:37 +0100)]
Merge pull request #1688 from chiragshah6/mdev

ospfd: Fix default-info and redis cmd options

7 years agolib, pimd: Remove PIM_NODE as it is not needed 1696/head
Donald Sharp [Tue, 30 Jan 2018 08:07:15 +0000 (03:07 -0500)]
lib, pimd: Remove PIM_NODE as it is not needed

The PIM_NODE command is only being used to display
default vrf configuration.  Move this into the
vrf display and remove PIM_NODE.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoospfd: Fix default-info and redis cmd options 1688/head
Chirag Shah [Tue, 30 Jan 2018 02:03:08 +0000 (18:03 -0800)]
ospfd: Fix default-info and redis cmd options

Fix default-information parsing of metric-type,
route-map.
show running to display metic-type 2.

metric, metric-type and route-map can be configured in
any order, running-config displays in specific order..

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
7 years agozebra: Fix v6 nexthop-vrf and nexthop confusion 1693/head
Donald Sharp [Tue, 30 Jan 2018 05:15:45 +0000 (00:15 -0500)]
zebra: Fix v6 nexthop-vrf and nexthop confusion

The v6 code had the same issue with how it handled
nexthop-vrf and nexthop when it was entered on the
same line.  This fixes that issue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra: Fix crash when dereferencing dest->selected_fib 1687/head
Donald Sharp [Mon, 29 Jan 2018 22:52:15 +0000 (17:52 -0500)]
zebra: Fix crash when dereferencing dest->selected_fib

When a rib_unlink() event is directly called for a
route_entry we need to see if the dest->selected_fib
is the same and just unset the dest->selected_fib.

This was happening for redistributed table 10 routes
into BGP.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #1686 from donaldsharp/mem_leaks_zebra
Renato Westphal [Mon, 29 Jan 2018 22:41:07 +0000 (20:41 -0200)]
Merge pull request #1686 from donaldsharp/mem_leaks_zebra

Mem leaks zebra

7 years agoMerge pull request #1684 from donaldsharp/vrf_leak
Renato Westphal [Mon, 29 Jan 2018 22:34:02 +0000 (20:34 -0200)]
Merge pull request #1684 from donaldsharp/vrf_leak

zebra: Fix to get correct nexthop-vrf

7 years agozebra: On shutdown actually delete rn's assoc w/ other_tables 1686/head
Donald Sharp [Mon, 29 Jan 2018 21:20:41 +0000 (16:20 -0500)]
zebra: On shutdown actually delete rn's assoc w/ other_tables

Zebra stores routes coming from the kernel for non-default
tables.  This information on shutdown was being leaked
because we never cleaned it up.  Allow for this to happen
now.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #1685 from LabNConsulting/working/vpn-doc
Donald Sharp [Mon, 29 Jan 2018 20:51:30 +0000 (15:51 -0500)]
Merge pull request #1685 from LabNConsulting/working/vpn-doc

doc: minor cleanup of bgp vpnvX and remove encap safi references

7 years agolib: When we shutdown we would leak interface description
Donald Sharp [Mon, 29 Jan 2018 20:38:03 +0000 (15:38 -0500)]
lib: When we shutdown we would leak interface description

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com.