]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
6 years agodebianpkg: wrap & sort dependency lines in control
David Lamparter [Fri, 26 Oct 2018 12:00:43 +0000 (14:00 +0200)]
debianpkg: wrap & sort dependency lines in control

Muuuuch more readable...

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agoMerge pull request #3594 from pguibert6WIND/flowspec_support_nh_tracking_70
Lou Berger [Tue, 15 Jan 2019 16:50:38 +0000 (11:50 -0500)]
Merge pull request #3594 from pguibert6WIND/flowspec_support_nh_tracking_70

bgpd: flowspec redirect IP info is retrieved into nh tracking

6 years agoMerge pull request #3608 from opensourcerouting/70-bfd-24-minutes
Donald Sharp [Mon, 14 Jan 2019 15:26:56 +0000 (10:26 -0500)]
Merge pull request #3608 from opensourcerouting/70-bfd-24-minutes

7.0: bfdd: Fix timer print-out function

6 years agobfdd: Fix timer print-out function
Donald Sharp [Sat, 12 Jan 2019 21:22:32 +0000 (16:22 -0500)]
bfdd: Fix timer print-out function

The timer2str function thought 24 minutes was an hour and had a
couple of other issues that needed to be corrected.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit 23586b0552ee08e24d4c1f54bb4913c48c1e14aa)

6 years agoMerge pull request #3593 from donaldsharp/label_to_zebra_7.0
Renato Westphal [Mon, 14 Jan 2019 12:47:03 +0000 (10:47 -0200)]
Merge pull request #3593 from donaldsharp/label_to_zebra_7.0

bgpd: Do not send a label to zebra that it doesn't understand

6 years agobgpd: flowspec redirect IP info is retrieved into nh tracking
Philippe Guibert [Tue, 4 Dec 2018 08:33:21 +0000 (09:33 +0100)]
bgpd: flowspec redirect IP info is retrieved into nh tracking

redirect IP nh of flowspec entry is retrieved so that the nexthop
IP information is injected into the nexthop tracking, and is associated
to the bgp_path structure. This permits validating or unvalidating the
bgp_path for injection in zebra or not.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agoMerge pull request #3598 from pguibert6WIND/handle_multiple_netns_delete_event_70
Donald Sharp [Fri, 11 Jan 2019 12:32:35 +0000 (07:32 -0500)]
Merge pull request #3598 from pguibert6WIND/handle_multiple_netns_delete_event_70

zebra: handle multiple events for netns deletion event

6 years agozebra: handle multiple events for netns deletion event
Philippe Guibert [Tue, 18 Dec 2018 17:00:31 +0000 (18:00 +0100)]
zebra: handle multiple events for netns deletion event

When handling events from /var/run/netns folder, if several netns are
removed at the same time, only the first one is deleted in the frr. Fix
this behaviour by applying continue in the loop.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agoMerge pull request #3596 from donaldsharp/pthread_7.0
Mark Stapp [Thu, 10 Jan 2019 18:27:02 +0000 (13:27 -0500)]
Merge pull request #3596 from donaldsharp/pthread_7.0

dev/7.0 DC of #3589 and #3590

6 years agolib: Convert RUSAGE_SELF to RUSAGE_THREAD where we can
Donald Sharp [Wed, 9 Jan 2019 17:18:21 +0000 (12:18 -0500)]
lib: Convert RUSAGE_SELF to RUSAGE_THREAD where we can

When using getrusage, we have multiple choices about what
to call for data gathering about this particular thread of execution.

RUSAGE_SELF -> This means gather all cpu run time for all pthreads associated
with this process.

RUSAGE_THREAD -> This means gather all cpu run time for this particular
pthread.

Clearly with data gathering for slow thread as well as `show thread cpu`
it would be preferable to gather only data about the current running
pthread.  This probably was the original behavior of using RUSAGE_SELF
when we didn't have multiple pthreads.  So it didn't matter so much.

Prior to this change, 10 iterations of 1 million routes install/remove
from zebra would give us this cpu time for the dataplane pthread:

Showing statistics for pthread Zebra dplane thread
--------------------------------------------------
                      CPU (user+system): Real (wall-clock):
Active   Runtime(ms)   Invoked Avg uSec Max uSecs Avg uSec Max uSecs  Type  Thread
    0     280902.149    326541      860   2609982      550   2468910    E  dplane_thread_loop

After this change we are seeing this:

Showing statistics for pthread Zebra dplane thread
--------------------------------------------------
                      CPU (user+system): Real (wall-clock):
Active   Runtime(ms)   Invoked Avg uSec Max uSecs Avg uSec Max uSecs  Type  Thread
    0      58045.560    334944      173    277226      539   2502268    E  dplane_thread_loop

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib, bgpd: Convert frr_pthread_set_name to only cause it to set os name of the thread
Donald Sharp [Wed, 9 Jan 2019 19:59:22 +0000 (14:59 -0500)]
lib, bgpd: Convert frr_pthread_set_name to only cause it to set os name of the thread

The current invocation of frr_pthread_set_name was causing it reset the os_name.
There is no need for this, we now always create the pthread appropriately
to have both name and os_name.  So convert this function to a simple
call through of the pthread call now.

Before(any of these changes):
sharpd@robot ~/frr1> ps -L -p 16895
  PID   LWP TTY          TIME CMD
16895 16895 ?        00:01:39 bgpd
16895 16896 ?        00:00:54
16895 16897 ?        00:00:07 bgpd_ka

After:
sharpd@donna ~/frr1> ps -L -p 1752
  PID   LWP TTY          TIME CMD
 1752  1752 ?        00:00:00 bgpd
 1752  1753 ?        00:00:00 bgpd_io
 1752  1754 ?        00:00:00 bgpd_ka

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Cleanup thread name setting to happen at start
Donald Sharp [Wed, 9 Jan 2019 19:32:44 +0000 (14:32 -0500)]
lib: Cleanup thread name setting to happen at start

When we start a thread we always call fpt_run and since
the last commit we know os_name is filled with something,
therefore we can just set the name on startup.

This creates this output now for zebra:

sharpd@donna ~/frr2> ps -L -p 25643
  PID   LWP TTY          TIME CMD
25643 25643 ?        00:00:00 zebra
25643 25644 ?        00:00:00 Zebra dplane
25643 25684 ?        00:00:00 zebra_apic
sharpd@donna ~/frr2>

I removed the abstraction to frr_pthread_set_name because
it was snprintf'ing into the same buffer which was the
real bug here( the first character of os_name became null).
In the next commit I'll remove that api because
it is unneeded and was a horrible hack to get
this to work for the one place it was wanted.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: On frr_pthread_new save a os_name
Donald Sharp [Wed, 9 Jan 2019 18:41:46 +0000 (13:41 -0500)]
lib: On frr_pthread_new save a os_name

On call of frr_pthread_new, save the os_name if given,
if not given use the name passed in( shortening to fit
in available space ) and finally if the name was not
passed in use the default value.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Do not send a label to zebra that it doesn't understand
Donald Sharp [Wed, 9 Jan 2019 13:48:37 +0000 (08:48 -0500)]
bgpd: Do not send a label to zebra that it doesn't understand

When using an `import vrf` mechanism we are marking
the vrf label as BGP_PREVENT_VRF_2_VRF_LEAK, and then sending
this down to zebra.  Since zebra knows nothing about this special
value, convert it to a value that it does know MPLS_LABEL_NONE.

This bug was introduced by: 13b7e7f007833c4e2942f40cbd2c2f93a2767e78

And shows up with this error message in the zebra log:

2019/01/09 08:25:16 ZEBRA: Extended Error: Label >= configured maximum in platform_labels
2019/01/09 08:25:16 ZEBRA: [EC 4043309093] netlink-cmd (NS 0) error: Invalid argument, type=RTM_NEWROUTE(24), seq=8, pid=3321825991
2019/01/09 08:25:16 ZEBRA: [EC 4043309103] LSP Install Failure: 4294967294

And zebra kept the label as:
donna.cumulusnetworks.com# show mpls table
 Inbound                            Outbound
   Label     Type          Nexthop     Label
--------  -------  ---------------  --------
      -2      BGP            GREEN
      -2      BGP             BLUE

After this fix, neither the labels are stored in zebra nor do we see
the log error message.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #3585 from pguibert6WIND/fix_vrf_netns_broken_70
Donald Sharp [Tue, 8 Jan 2019 18:28:28 +0000 (13:28 -0500)]
Merge pull request #3585 from pguibert6WIND/fix_vrf_netns_broken_70

zebra: update local ns_id field

6 years agoMerge pull request #3584 from opensourcerouting/70-freebsd-route-fix
Donald Sharp [Tue, 8 Jan 2019 18:20:46 +0000 (13:20 -0500)]
Merge pull request #3584 from opensourcerouting/70-freebsd-route-fix

dev/7.0: zebra: fix FreeBSD breakage

6 years agozebra: update local ns_id field
Philippe Guibert [Mon, 7 Jan 2019 08:55:10 +0000 (09:55 +0100)]
zebra: update local ns_id field

ns_id field must be synced with ns_id from netns service.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: fix another FreeBSD warning message
Rafael Zalamena [Tue, 8 Jan 2019 12:37:22 +0000 (10:37 -0200)]
zebra: fix another FreeBSD warning message

When an empty netmask a wrong end size is calculated, lets handle this
corner case to avoid spurious warning messages.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 2d100aa5f12d1b5e09411fd27d0e3938cf4305db)

6 years agozebra: fix FreeBSD warning on fresh OS boot
Rafael Zalamena [Tue, 8 Jan 2019 12:32:28 +0000 (10:32 -0200)]
zebra: fix FreeBSD warning on fresh OS boot

Handle corner case where a warning log message is issued on interface
address netmask handling with sockaddr type AF_LINK: it may come empty
or with match all (all 0xFF).

In the first case all lengths are zero and we only need to copy the
first bytes, second case it comes with a zero index and all 0xFF bytes.

In any case we only need to figure out a few of the first bytes instead
of all data.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 75e710df7a21d980bba9e5b2260408a3b30d4145)

6 years agozebra: implement FreeBSD route attr handling
Rafael Zalamena [Tue, 8 Jan 2019 10:14:28 +0000 (08:14 -0200)]
zebra: implement FreeBSD route attr handling

When porting routing socket macro data handling to functions, the
attribute function was forgotten. The only difference between the
attribute and address handler is the family type check.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 19fb538dc116c837af3bb1a76526cbb9a39d1bfc)

6 years agoMerge pull request #3576 from LabNConsulting/working/7.0/no-bgp-attr-255
Donald Sharp [Mon, 7 Jan 2019 23:45:06 +0000 (18:45 -0500)]
Merge pull request #3576 from LabNConsulting/working/7.0/no-bgp-attr-255

7.0: bgpd: don't use BGP_ATTR_VNC(255) unless ENABLE_BGP_VNC_ATTR is defined

6 years agoMerge pull request #3573 from manuhalo/dev7_fix_isis_p2p
Donald Sharp [Mon, 7 Jan 2019 22:31:46 +0000 (17:31 -0500)]
Merge pull request #3573 from manuhalo/dev7_fix_isis_p2p

[dev/7.0] isisd: fix point-to-point network type config

6 years agobgp_rfapi_basic_sanity_config2: delayed timeouts not supported without VNC attr
Lou Berger [Mon, 7 Jan 2019 22:16:37 +0000 (22:16 +0000)]
bgp_rfapi_basic_sanity_config2: delayed timeouts not supported without VNC attr

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agobgp_rfapi_basic_sanity: delayed timeouts not supported without VNC attr
Lou Berger [Mon, 7 Jan 2019 20:00:34 +0000 (20:00 +0000)]
bgp_rfapi_basic_sanity: delayed timeouts not supported without VNC attr

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agobgpd: don't use BGP_ATTR_VNC(255) unless ENABLE_BGP_VNC_ATTR is defined
Lou Berger [Mon, 7 Jan 2019 16:32:54 +0000 (11:32 -0500)]
bgpd: don't use BGP_ATTR_VNC(255) unless ENABLE_BGP_VNC_ATTR is defined

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agoisisd: fix point-to-point network type config
Emanuele Di Pascale [Mon, 7 Jan 2019 11:29:29 +0000 (12:29 +0100)]
isisd: fix point-to-point network type config

`isis network point-to-point` was being rejected from the configuration
file as it was being processed before the reception of the UP zebra
notification for the interface. This meant that the `circ_type` was set
at CIRCUIT_T_UNKNOWN, which led the northbound callback to fail. This
check was removed as it was not really necessary; when the zebra
notification is received, the correct circuit type will be enforced,
but now the point-to-point config will be saved and correctly applied
when zebra recognizes the interface as a broadcast one.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
6 years agoMerge pull request #3561 from opensourcerouting/northbound-freebsd-fix
Quentin Young [Thu, 3 Jan 2019 16:48:31 +0000 (11:48 -0500)]
Merge pull request #3561 from opensourcerouting/northbound-freebsd-fix

lib: fix segfault on freebsd when using vsnprintf() incorrectly

6 years agoMerge pull request #3558 from opensourcerouting/silence-ioctl-warning
Russ White [Thu, 3 Jan 2019 02:43:18 +0000 (21:43 -0500)]
Merge pull request #3558 from opensourcerouting/silence-ioctl-warning

zebra: silence harmless ioctl warning when retrieving interface speed

6 years agoMerge pull request #3560 from opensourcerouting/fix-sh-bgp-community
Russ White [Thu, 3 Jan 2019 02:42:50 +0000 (21:42 -0500)]
Merge pull request #3560 from opensourcerouting/fix-sh-bgp-community

bgpd: fix parsing of community number in the "show bgp community" command

6 years agoMerge pull request #3549 from chiragshah6/mdev
Russ White [Thu, 3 Jan 2019 02:39:58 +0000 (21:39 -0500)]
Merge pull request #3549 from chiragshah6/mdev

bgpd: evpn command to restrict to default vrf

6 years agolib: fix segfault on freebsd when using vsnprintf() incorrectly
Renato Westphal [Thu, 3 Jan 2019 00:32:13 +0000 (22:32 -0200)]
lib: fix segfault on freebsd when using vsnprintf() incorrectly

FreeBSD's libc segfaults when vsnprintf() is called with a null
format string. Add a null check before calling vsnprintf() to
resolve this problem.

Fixes #3537

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agobgpd: fix parsing of community number in the "show bgp community" command
Renato Westphal [Wed, 2 Jan 2019 21:25:02 +0000 (19:25 -0200)]
bgpd: fix parsing of community number in the "show bgp community" command

Fixes #3545.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agozebra: silence harmless ioctl warning when retrieving interface speed
Renato Westphal [Wed, 2 Jan 2019 18:47:51 +0000 (16:47 -0200)]
zebra: silence harmless ioctl warning when retrieving interface speed

zebra uses the SIOCETHTOOL ioctl with the ETHTOOL_GSET command to
fetch the speed of interfaces from the kernel. The only problem is
that ETHTOOL_GSET returns EOPNOTSUPP when the given interface is a
virtual interface. This leads to zebra emitting warnings like this
at startup:

ZEBRA: IOCTL failure to read interface lo speed: 95 Operation not supported
ZEBRA: IOCTL failure to read interface dummy0 speed: 95 Operation not supported
ZEBRA: IOCTL failure to read interface ovs-system speed: 95 Operation not supported

Silence these warnings by ignoring EOPNOTSUPP errors, since we know
they are harmless. This is similar to how we handle EINVAL errors
from the BSD SIOCGIFMEDIA ioctl (commit c69f2c1ff).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agoMerge pull request #3553 from opensourcerouting/fix-interface-vrf-update-msg
Quentin Young [Wed, 2 Jan 2019 18:50:47 +0000 (13:50 -0500)]
Merge pull request #3553 from opensourcerouting/fix-interface-vrf-update-msg

zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message

6 years agoMerge pull request #3550 from donaldsharp/sharp_nhg
Renato Westphal [Wed, 2 Jan 2019 16:42:34 +0000 (14:42 -0200)]
Merge pull request #3550 from donaldsharp/sharp_nhg

Sharp nhg

6 years agoMerge pull request #3534 from opensourcerouting/netlink-length-duplicated
Quentin Young [Wed, 2 Jan 2019 15:53:49 +0000 (10:53 -0500)]
Merge pull request #3534 from opensourcerouting/netlink-length-duplicated

zebra: remove duplicated code

6 years agozebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
Renato Westphal [Wed, 2 Jan 2019 15:05:53 +0000 (13:05 -0200)]
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message

Unlike the other interface zapi messages, ZEBRA_INTERFACE_VRF_UPDATE
identifies interfaces using ifindexes and not interface names. This
is a problem because zebra always sends ZEBRA_INTERFACE_DOWN
and ZEBRA_INTERFACE_DELETE messages before sending
ZEBRA_INTERFACE_VRF_UPDATE, and the ZEBRA_INTERFACE_DELETE callback
from all daemons set the interface index to IFINDEX_INTERNAL. Hence,
when decoding a ZEBRA_INTERFACE_VRF_UPDATE message, the interface
lookup would always fail since the corresponding interface lost
its ifindex. Example (ospfd):

OSPF: Zebra: Interface[rt1-eth2] state change to down.
OSPF: Zebra: interface delete rt1-eth2 vrf default[0] index 8 flags 11143 metric 0 mtu 1500
OSPF: [EC 100663301] INTERFACE_VRF_UPDATE: Cannot find IF 8 in VRF 0

To fix this problem, use interface names instead of ifindexes to
indentify interfaces like the other interface zapi messages do.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agosharpd: Allow sharpd to accept nexthop group as part of route install
Donald Sharp [Mon, 31 Dec 2018 22:49:47 +0000 (17:49 -0500)]
sharpd: Allow sharpd to accept nexthop group as part of route install

When installing routes via sharpd 'sharp install route... ' command
add the ability to specify a nexthop-group to use.  This will
allow sharpd to create ECMP routes into zebra.

Nexthop-group:
!
nexthop-group JANELLE
  nexthop 192.168.209.1
  nexthop 192.168.210.1
!

The install:

donna.cumulusnetworks.com# sharp install routes 10.0.50.0 nexthop-group JANELLE 10
donna.cumulusnetworks.com# end
donna.cumulusnetworks.com# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route

K>* 0.0.0.0/0 [0/106] via 10.0.2.2, enp0s3, 00:20:38
C>* 10.0.2.0/24 is directly connected, enp0s3, 00:20:38
D>* 10.0.50.0/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.1/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.2/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.3/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.4/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.5/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.6/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.7/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.8/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
D>* 10.0.50.9/32 [150/0] via 192.168.209.1, enp0s8, 00:00:02
  *                      via 192.168.210.1, enp0s9, 00:00:02
C>* 192.168.209.0/24 is directly connected, enp0s8, 00:20:38
C>* 192.168.210.0/24 is directly connected, enp0s9, 00:20:38
donna.cumulusnetworks.com#

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agosharpd/vtysh: Allow sharpd to use nexthop-groups
Donald Sharp [Mon, 31 Dec 2018 22:48:36 +0000 (17:48 -0500)]
sharpd/vtysh: Allow sharpd to use nexthop-groups

Allow the sharp daemon to understand and use nexthop-groups.

This commit is merely to allow sharpd to understand them
when accepted in a future commit

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agosharp: Modify route install to take nexthop groups
Donald Sharp [Mon, 31 Dec 2018 22:28:13 +0000 (17:28 -0500)]
sharp: Modify route install to take nexthop groups

Modify the route_add function to take nexthop groups.  Future commits
will allow sharpd to use nexthop groups as the install mechanism
for routes.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #3543 from donaldsharp/eigrp_router_id_is_the_bee
Renato Westphal [Wed, 2 Jan 2019 00:39:03 +0000 (22:39 -0200)]
Merge pull request #3543 from donaldsharp/eigrp_router_id_is_the_bee

Eigrp router id cleanup

6 years agoMerge pull request #3540 from donaldsharp/staic
Renato Westphal [Wed, 2 Jan 2019 00:36:59 +0000 (22:36 -0200)]
Merge pull request #3540 from donaldsharp/staic

staticd: Do not ready prefix for printing till it's decoded

6 years agoMerge pull request #3246 from pguibert6WIND/distribute_vrf_aware
Renato Westphal [Wed, 2 Jan 2019 00:34:59 +0000 (22:34 -0200)]
Merge pull request #3246 from pguibert6WIND/distribute_vrf_aware

Distribute vrf aware

6 years agobgpd: evpn command to restrict to default vrf
Chirag Shah [Mon, 31 Dec 2018 21:18:21 +0000 (13:18 -0800)]
bgpd: evpn command to restrict to default vrf

Certain EVPN configuartions should only be applied
under DEFAULT VRF bgpd instance.

reject the cli for non default bgp instance

Ticket:CM-18950

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agoMerge pull request #3546 from opensourcerouting/ospf-show-neighbor-fix
Donald Sharp [Mon, 31 Dec 2018 14:26:37 +0000 (09:26 -0500)]
Merge pull request #3546 from opensourcerouting/ospf-show-neighbor-fix

ospfd: fix wrong argv index in the "show ip ospf neighbor" command

6 years agoospfd: convert a couple of "show" commands to DEFPY
Renato Westphal [Mon, 31 Dec 2018 13:11:15 +0000 (11:11 -0200)]
ospfd: convert a couple of "show" commands to DEFPY

DEFPY commands are easier to maintain and less susceptible to
bugs. In the long term we should try to merge the plethora of
"show ip ospf neighbor" commands (total of 14) into a single DEFPY.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agoospfd: fix wrong argv index in the "show ip ospf neighbor" command
Renato Westphal [Mon, 31 Dec 2018 13:02:49 +0000 (11:02 -0200)]
ospfd: fix wrong argv index in the "show ip ospf neighbor" command

Fixes Issue #3544.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agoeigrpd: Allow eigrp to set/unset the router-id as a value.
Donald Sharp [Mon, 31 Dec 2018 00:59:52 +0000 (19:59 -0500)]
eigrpd: Allow eigrp to set/unset the router-id as a value.

This code addition allows eigrp to set/unset the router-id
value.  At this point I am not 100% sure that we do all the necessary
rework when a router-id changes.  But on startup if read in before
a network statement we should be ok.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoeigrpd: eigrp usage of uint32_t to struct in_addr for router_id data
Donald Sharp [Mon, 31 Dec 2018 00:54:25 +0000 (19:54 -0500)]
eigrpd: eigrp usage of uint32_t to struct in_addr for router_id data

In eigrp we were using a uint32_t to hold the `struct in_addr` data
for the router id values.  This caused us to do unnecessary conversions
pre and post for in/out.  Let's just use the standard `struct in_addr`

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoeigrpd: Write eigrp config even if no network statements yet
Donald Sharp [Mon, 31 Dec 2018 00:44:27 +0000 (19:44 -0500)]
eigrpd: Write eigrp config even if no network statements yet

Let's write the eigrp config even if we have no network statements
as that the other functions return safely if nothing to do here.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: replace zlog_err with flog_err
Rafael Zalamena [Sat, 29 Dec 2018 09:14:14 +0000 (07:14 -0200)]
zebra: replace zlog_err with flog_err

Change the logging mechanism for truncated netlink error messages.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
6 years agostaticd: Do not ready prefix for printing till it's decoded
Donald Sharp [Fri, 28 Dec 2018 02:46:01 +0000 (21:46 -0500)]
staticd: Do not ready prefix for printing till it's decoded

The static daemon is setting up the prefix for printing
before it is decoded when we get notified about our
route.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib, rip, ripng, babel, eigrp: add ctx pointer to distribute api
Philippe Guibert [Tue, 4 Dec 2018 14:45:57 +0000 (15:45 +0100)]
lib, rip, ripng, babel, eigrp: add ctx pointer to distribute api

a distribute_ctx context pointer is returned after initialisation to the
calling daemon. this context pointer will be further used to do
discussion with distribute service. Today, there is no specific problem
with old api, since the pointer is the same in all the memory process.
but the pointer will be different if we have multiple instances. Right
now, this is not the case, but if that happens, that work will be used
for that.
distribute-list initialisation is split in two. the vty initialisation
is done at global level, while the context initialisation is done for
each routing daemon instance.
babel daemon is being equipped with a routing returning the main babel
instance.
also, a delete routine is available when the daemon routing instance is
suppressed.
a list of contexts is used inside distribute_list. This will permit
distribute_list utility to handle in the same daemon to handle more than
one context. This will be very useful in the vrf context.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agolib: enforce vrf_name_to_id by returning default_vrf when name is null
Philippe Guibert [Tue, 20 Nov 2018 09:30:47 +0000 (10:30 +0100)]
lib: enforce vrf_name_to_id by returning default_vrf when name is null

in order to enforce the vrf_id to return, from a vrf name, a check is
done on the vrf_name_to_id callback.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agoMerge pull request #3535 from kareiva/master
Quentin Young [Thu, 27 Dec 2018 21:25:26 +0000 (16:25 -0500)]
Merge pull request #3535 from kareiva/master

Fix typos in BGPd sample configuration file

6 years agoFix typos in BGPd sample configuration file
Simonas [Thu, 27 Dec 2018 07:13:55 +0000 (09:13 +0200)]
Fix typos in BGPd sample configuration file

6 years agozebra: remove duplicated code
Rafael Zalamena [Wed, 26 Dec 2018 18:57:46 +0000 (16:57 -0200)]
zebra: remove duplicated code

Remove duplicated netlink error message length check.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
6 years agoMerge pull request #3527 from opensourcerouting/ldpd-bsd-fixes
Donald Sharp [Sat, 22 Dec 2018 01:20:48 +0000 (20:20 -0500)]
Merge pull request #3527 from opensourcerouting/ldpd-bsd-fixes

ldpd: *BSD fixes

6 years agoldpd: fix startup on OpenBSD
Rafael Zalamena [Fri, 21 Dec 2018 22:59:18 +0000 (20:59 -0200)]
ldpd: fix startup on OpenBSD

We must open the PF_KEY socket before dropping privileges, otherwise the
socket creation will fail with permission problems.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
6 years agozebra: fix compilation on OpenBSD
Rafael Zalamena [Fri, 21 Dec 2018 19:03:05 +0000 (17:03 -0200)]
zebra: fix compilation on OpenBSD

OpenBSD doesn't define RTM_LOCK anymore:
https://marc.info/?l=openbsd-tech&m=153018811429193&w=2

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
6 years agoldpd: add support for FreeBSD IP_BINDANY
Rafael Zalamena [Fri, 21 Dec 2018 14:27:44 +0000 (12:27 -0200)]
ldpd: add support for FreeBSD IP_BINDANY

Add yet another way to setsockopt a socket to listen to a foreign
address.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
6 years agoMerge pull request #3499 from donaldsharp/topotest_inheritance
Rafael Zalamena [Thu, 20 Dec 2018 17:52:03 +0000 (15:52 -0200)]
Merge pull request #3499 from donaldsharp/topotest_inheritance

Topotest inheritance

6 years agoMerge pull request #3327 from adeg/feature/bgp-lu-auto-labels
Renato Westphal [Thu, 20 Dec 2018 15:59:28 +0000 (13:59 -0200)]
Merge pull request #3327 from adeg/feature/bgp-lu-auto-labels

bgpd, zebra: auto assign labels to regular labeled-unicast prefixes

6 years agobgpd, zebra: auto assign labels from label pool to regular prefixes in BGP labeled...
Anton Degtyarev [Wed, 14 Nov 2018 03:14:04 +0000 (06:14 +0300)]
bgpd, zebra: auto assign labels from label pool to regular prefixes in BGP labeled unicast

This commit is the last missing piece to complete BGP LU support in bgpd. To this moment, bgpd (and zebra) supported auto label assignment only for prefixes leaked from VRFs to vpn and for MPLS SR prefixes. This adds auto label assignment to other routes types in bgpd. The following enhancements have been made:
* bgp_route.c:bgp_process_main_one() now sets implicit-null local_label to all local, aggregate and redistributed routes.
* bgp_route.c:bgp_process_main_one() now will request a label from the label pool for any prefix that loses the label for some reason (for example, when the static label assignment config is removed)
* bgp_label.c:bgp_reg_dereg_for_label() now requests labels from label pool for routes which have no associated label index
* zebra_mpls.c:zebra_mpls_fec_register() now expects both label and label_index from the calling function, one of which must be set to MPLS_INVALID_LABEL or MPLS_INVALID_LABEL_INDEX, based on this it will decide how to register the provided FEC.

Signed-off-by: Anton Degtyarev <anton@cumulusnetworks.com>
6 years agoMerge pull request #3516 from qlyoung/doc-ip-nht-resolve-via-default
Renato Westphal [Thu, 20 Dec 2018 12:05:01 +0000 (10:05 -0200)]
Merge pull request #3516 from qlyoung/doc-ip-nht-resolve-via-default

doc: add `ip nht resolve-via-default`

6 years agoMerge pull request #3517 from qlyoung/doc-exclude-snmptrap
Renato Westphal [Thu, 20 Dec 2018 12:04:13 +0000 (10:04 -0200)]
Merge pull request #3517 from qlyoung/doc-exclude-snmptrap

doc: exclude snmptrap.rst from build

6 years agoMerge pull request #3515 from mjstapp/fix_rib_wq_timer
Donald Sharp [Wed, 19 Dec 2018 20:33:56 +0000 (15:33 -0500)]
Merge pull request #3515 from mjstapp/fix_rib_wq_timer

zebra: reduce rib workqueue retry timeout

6 years agodoc: exclude snmptrap.rst from build
Quentin Young [Wed, 19 Dec 2018 18:08:42 +0000 (18:08 +0000)]
doc: exclude snmptrap.rst from build

This doc is .. include::'d in snmp.rst and needs to be ignored as part
of the main toctree build. This patch squashes a Sphinx build warning.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agodoc: add `ip nht resolve-via-default`
Quentin Young [Wed, 19 Dec 2018 17:55:05 +0000 (17:55 +0000)]
doc: add `ip nht resolve-via-default`

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #3513 from mjstapp/fix_dplane_q_include
Quentin Young [Wed, 19 Dec 2018 17:11:24 +0000 (12:11 -0500)]
Merge pull request #3513 from mjstapp/fix_dplane_q_include

zebra: include lib/queue.h in zebra dataplane

6 years agoMerge pull request #3492 from donaldsharp/no_set_community
Russ White [Wed, 19 Dec 2018 16:57:01 +0000 (11:57 -0500)]
Merge pull request #3492 from donaldsharp/no_set_community

bgpd: Allow 'no set community`

6 years agozebra: reduce rib workqueue retry timeout
Mark Stapp [Wed, 19 Dec 2018 16:51:41 +0000 (11:51 -0500)]
zebra: reduce rib workqueue retry timeout

Reduce the zebra rib workqueue retry timeout, used when the queue
towards the zebra dataplane has reached its limit. Lowering the
value was reported to improve update throughput on some platforms.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
6 years agoMerge pull request #3502 from donaldsharp/socket_to_me_baby
Russ White [Wed, 19 Dec 2018 16:48:42 +0000 (11:48 -0500)]
Merge pull request #3502 from donaldsharp/socket_to_me_baby

BSD route socket refactoring/cleanup

6 years agozebra: Fixup spaces/tabs issue found by CI in rt_socket.c
Donald Sharp [Wed, 19 Dec 2018 00:32:14 +0000 (19:32 -0500)]
zebra: Fixup spaces/tabs issue found by CI in rt_socket.c

Cleanup the space/tabs issues found by CI in rt_socket.c so
it stops complaining at us.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Make label processing guaranteed to be unique
Donald Sharp [Wed, 19 Dec 2018 00:34:22 +0000 (19:34 -0500)]
zebra: Make label processing guaranteed to be unique

The label processing for socket installs was not ensuring
that each nexthop would not accidently use the last
nexthops value.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: include lib/queue.h in zebra dataplane
Mark Stapp [Wed, 19 Dec 2018 14:03:33 +0000 (09:03 -0500)]
zebra: include lib/queue.h in zebra dataplane

Replace direct use of one of the platform-specific xxx-queue.h
headers - use the wrapper queue.h instead.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
6 years agozebra: Convert gate in kernel_rtm to a bool
Donald Sharp [Mon, 17 Dec 2018 23:34:26 +0000 (18:34 -0500)]
zebra: Convert gate in kernel_rtm to a bool

Convert the gate test int to a bool as that we use it this way.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: The mask and sin_mask are a bit redundant for kernel_rtm
Donald Sharp [Mon, 17 Dec 2018 23:31:09 +0000 (18:31 -0500)]
zebra: The mask and sin_mask are a bit redundant for kernel_rtm

The test we were using to ensure that a mask was sent in
is a bit redundant, let's just always send it in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Refactor kernel_rtm to be a bit smarter about how it handles options
Donald Sharp [Mon, 17 Dec 2018 23:21:38 +0000 (18:21 -0500)]
zebra: Refactor kernel_rtm to be a bit smarter about how it handles options

The ADD/DELETE messages are the only ones we support, so leave
early from the function, in other words don't check it every
nexthop loop.

Additionally nexthops only care about non recursive active flags.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Refactor kernel_socket kernel_rtm_ipv4 and ipv6 functions
Donald Sharp [Mon, 17 Dec 2018 19:23:02 +0000 (14:23 -0500)]
zebra: Refactor kernel_socket kernel_rtm_ipv4 and ipv6 functions

Refactor both v4 and v6 functions down to 1 install function.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Move sin6_masklen to earlier in the file
Donald Sharp [Mon, 17 Dec 2018 21:28:47 +0000 (16:28 -0500)]
zebra: Move sin6_masklen to earlier in the file

I'm going to rearrage the kernel_rtm_ipv4 and v6 functions
so the sin6_masklen needs to be moved a bit earlier.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Convert socket interface to use `union sockunion`
Donald Sharp [Mon, 17 Dec 2018 18:57:04 +0000 (13:57 -0500)]
zebra: Convert socket interface to use `union sockunion`

The write function converted to v4 and v6 functions to a union sockunion
via casting.  Just use `union sockunion` instead.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Allow shortened 'no set large-community' and 'no set large-comm-list'
Donald Sharp [Wed, 19 Dec 2018 12:30:01 +0000 (07:30 -0500)]
bgpd: Allow shortened 'no set large-community' and 'no set large-comm-list'

These two commands previously required the whole original command but
we should allow the user to shorten out this since the data at the
end is not required to figure out what to delete.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Allow `no set extcommunity [rt|soo]`
Donald Sharp [Wed, 19 Dec 2018 12:22:26 +0000 (07:22 -0500)]
bgpd: Allow `no set extcommunity [rt|soo]`

The ability to shorten the extended community commands for routemaps
upon removal should be allowed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Allow 'no set community`
Donald Sharp [Sun, 16 Dec 2018 18:54:41 +0000 (13:54 -0500)]
bgpd: Allow 'no set community`

Allow user to enter `no set community` to remove the community
set for the route-map.

Fixes: #3491
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #3448 from chiragshah6/evpn_dev1
Sri Mohana Singamsetty [Wed, 19 Dec 2018 02:12:18 +0000 (18:12 -0800)]
Merge pull request #3448 from chiragshah6/evpn_dev1

bgpd: l3vni add-del handle non-defualt route-target

6 years agoMerge pull request #3507 from opensourcerouting/master-init-fixes
Donald Sharp [Wed, 19 Dec 2018 00:21:39 +0000 (19:21 -0500)]
Merge pull request #3507 from opensourcerouting/master-init-fixes

[master] minor tools/ fixes

6 years agoMerge pull request #3503 from qlyoung/fix-bgpd-show-ip-neigh-json-double-free
David Lamparter [Tue, 18 Dec 2018 17:01:48 +0000 (18:01 +0100)]
Merge pull request #3503 from qlyoung/fix-bgpd-show-ip-neigh-json-double-free

bgpd: fix json double free when showing neighbors

6 years agozebra: Allow ns delete to happen after under/over flow checks
Donald Sharp [Mon, 17 Dec 2018 02:36:49 +0000 (21:36 -0500)]
zebra: Allow ns delete to happen after under/over flow checks

Allow the ns deletion event to happen *after* the data validity
checks.

Please note this probably still leaves a weird hole if we receive
multiple namespace events ( as the for loop implies ).  We will
stop handling anything after a namespace deletion notification.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #3485 from dslicenc/frr-reload-delete-vrf
David Lamparter [Tue, 18 Dec 2018 16:54:28 +0000 (17:54 +0100)]
Merge pull request #3485 from dslicenc/frr-reload-delete-vrf

tools: stop frr-reload.py from trying to delete the vrf context

6 years agoMerge pull request #3422 from pguibert6WIND/license_gplv3_rule
David Lamparter [Tue, 18 Dec 2018 16:42:27 +0000 (17:42 +0100)]
Merge pull request #3422 from pguibert6WIND/license_gplv3_rule

doc: add a community rule to permit usage of GPLv3

6 years agoMerge pull request #3337 from manuhalo/isis_nb
Donald Sharp [Tue, 18 Dec 2018 16:33:40 +0000 (11:33 -0500)]
Merge pull request #3337 from manuhalo/isis_nb

IS-IS northbound conversion - configuration and notifications only

6 years agoisisd: suppress maybe uninitialized warnings
Emanuele Di Pascale [Tue, 11 Dec 2018 09:55:32 +0000 (10:55 +0100)]
isisd: suppress maybe uninitialized warnings

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
6 years agoisisd, yang: set default network-type to broadcast
Emanuele Di Pascale [Mon, 10 Dec 2018 14:18:25 +0000 (15:18 +0100)]
isisd, yang: set default network-type to broadcast

isisd has both a circ_type and a circ_type_config variable to track
the network tpye of an interface. The former has no default, but the
latter defaults to broadcast. Adding that default makes sure that the
yang leaf won't be deleted, which is something that would not make
sense from an isisd perspective. We will need to add an operational
state leaf to match the potential difference between the configured
network type and the actual network type, since the latter might be
different based on the interface flags received from zebra.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
6 years agoisisd: formatting fixes in isis_cli.c
Emanuele Di Pascale [Mon, 10 Dec 2018 13:56:16 +0000 (14:56 +0100)]
isisd: formatting fixes in isis_cli.c

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
6 years agoisisd: fix 'no router isis' on candidate config
Emanuele Di Pascale [Mon, 10 Dec 2018 13:54:48 +0000 (14:54 +0100)]
isisd: fix 'no router isis' on candidate config

if we are using the transactional CLI, we might be trying to
delete an area that has not been actually created in isisd.
So rather than relying on isis_area_lookup, check the candidate
config for the presence of the corresponding area instance.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
6 years agoisisd: retrieve default values from the yang model
Emanuele Di Pascale [Mon, 10 Dec 2018 13:30:40 +0000 (14:30 +0100)]
isisd: retrieve default values from the yang model

also fix a minor issue with isis_config_write where we were
not incrementing the write variable, which is used to append
a new line at the end of the vty string

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
6 years agolib: add frr-isisd to the native models
Emanuele Di Pascale [Mon, 10 Dec 2018 11:07:54 +0000 (12:07 +0100)]
lib: add frr-isisd to the native models

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
6 years agoisisd: implement sighup handler
Emanuele Di Pascale [Mon, 10 Dec 2018 11:02:32 +0000 (12:02 +0100)]
isisd: implement sighup handler

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
6 years agoisisd, yang: change type empty leafs to booleans
Emanuele Di Pascale [Mon, 10 Dec 2018 10:44:30 +0000 (11:44 +0100)]
isisd, yang: change type empty leafs to booleans

As requested by the reviewers. Additionally, added a check when
setting a circuit on an interface to see if it is a loopback,
and in that case, set it to passive.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>