]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
6 years agosnapcraft: Add FabricD to Snap package
Martin Winter [Thu, 7 Feb 2019 23:12:14 +0000 (15:12 -0800)]
snapcraft: Add FabricD to Snap package

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agosnapcraft: Update bgpd to use newer rpki lib
Martin Winter [Thu, 7 Feb 2019 22:44:47 +0000 (14:44 -0800)]
snapcraft: Update bgpd to use newer rpki lib

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agosnapcraft: Add missing staticd.conf.default
Martin Winter [Thu, 7 Feb 2019 15:07:25 +0000 (07:07 -0800)]
snapcraft: Add missing staticd.conf.default

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agosnapcraft: Add libyang to snap package
Martin Winter [Thu, 17 Jan 2019 19:02:04 +0000 (11:02 -0800)]
snapcraft: Add libyang to snap package

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agosnapcraft: Don't stage libc6
Martin Winter [Thu, 17 Jan 2019 19:01:05 +0000 (11:01 -0800)]
snapcraft: Don't stage libc6

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agosnapcraft: Update RTRLIB to 0.6.3
Martin Winter [Thu, 17 Jan 2019 16:32:47 +0000 (08:32 -0800)]
snapcraft: Update RTRLIB to 0.6.3

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agoMerge pull request #3663 from opensourcerouting/7.0/yang-embed-extensions
Donald Sharp [Fri, 8 Feb 2019 21:21:53 +0000 (16:21 -0500)]
Merge pull request #3663 from opensourcerouting/7.0/yang-embed-extensions

[7.0] yang: embed extensions

6 years agoMerge pull request #3750 from opensourcerouting/7.0/rpki-fixes
Donald Sharp [Thu, 7 Feb 2019 22:24:22 +0000 (17:24 -0500)]
Merge pull request #3750 from opensourcerouting/7.0/rpki-fixes

[7.0] RPKI fixes

6 years agobgpd: fix crash when trying to remove non-existing rpki cache
Marcel Röthke [Thu, 7 Feb 2019 16:16:19 +0000 (17:16 +0100)]
bgpd: fix crash when trying to remove non-existing rpki cache

Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
6 years agobgpd: fix "show rpki cache-server" for ssh caches
Marcel Röthke [Thu, 7 Feb 2019 16:12:16 +0000 (17:12 +0100)]
bgpd: fix "show rpki cache-server" for ssh caches

Fix #3662

Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
6 years agobgpd: make valgrind suppression more generic
David Lamparter [Thu, 7 Feb 2019 15:25:33 +0000 (16:25 +0100)]
bgpd: make valgrind suppression more generic

No point in restriction the suppression that far down the call stack.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agolib: yang: use common yang_ctx_new_setup()
David Lamparter [Mon, 4 Feb 2019 21:56:50 +0000 (22:56 +0100)]
lib: yang: use common yang_ctx_new_setup()

After creating a libyang context, we need to hook up our callback to use
embedded built-in modules.  I hadn't added this to the yang translator
code.

Also, ly_ctx_new fails if the search directory doesn't exist.  Since
that's not a hard error for us, work around that and ignore inaccessible
YANG_MODELS_DIR.  (This is needed for snap packages.)

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agoMerge pull request #3708 from pguibert6WIND/detach_vrf_labels_del_bgp_70
Donald Sharp [Thu, 31 Jan 2019 00:36:39 +0000 (19:36 -0500)]
Merge pull request #3708 from pguibert6WIND/detach_vrf_labels_del_bgp_70

[7.0] bgpd: detach vrf labels allocated, when removing bgp instance

6 years agobuild: fix a whole bunch of *FLAGS
David Lamparter [Wed, 30 Jan 2019 17:11:54 +0000 (18:11 +0100)]
build: fix a whole bunch of *FLAGS

- some target_CFLAGS that needed to include AM_CFLAGS didn't do so
- libyang/sysrepo/sqlite3/confd CFLAGS + LIBS weren't used at all
- consistently use $(FOO_CFLAGS) instead of @FOO_CFLAGS@
- 2 dependencies were missing for clippy

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agobuild, lib/yang: bake in extensions if possible
David Lamparter [Fri, 30 Nov 2018 20:42:25 +0000 (21:42 +0100)]
build, lib/yang: bake in extensions if possible

Starting with libyang 0.16.74, we can load internally embedded yang
extensions instead of going through the file system/dlopen.  Detect
support for this at build time and use if available.

NB: the fallback mechanism will go away in a short while.

Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agobgpd: detach vrf labels allocated, when removing bgp instance
Philippe Guibert [Mon, 28 Jan 2019 16:54:50 +0000 (17:54 +0100)]
bgpd: detach vrf labels allocated, when removing bgp instance

bgp instance is disabling the label allocated to reach vrf entity.
previously, only vrf disabling was removing the label. now, when bgp
leaves, bgp instance also frees the label used.

PR=62306
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Acked-by: Julien Floret <julien.floret@6wind.com>
6 years agoMerge pull request #3683 from opensourcerouting/70-ospf6-fix-mcast
Donald Sharp [Tue, 29 Jan 2019 16:03:49 +0000 (11:03 -0500)]
Merge pull request #3683 from opensourcerouting/70-ospf6-fix-mcast

7.0: ospf6d: fix multicast join race on FreeBSD

6 years agoospf6d: fix FreeBSD IPv6 multicast group join race
Rafael Zalamena [Sat, 26 Jan 2019 15:49:35 +0000 (13:49 -0200)]
ospf6d: fix FreeBSD IPv6 multicast group join race

Avoid a IPv6 multicast group join race by delaying the group install
before processing all event queue.

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

6 years agoospf6d: keep track of the socket set thread
Rafael Zalamena [Wed, 23 Jan 2019 12:25:30 +0000 (10:25 -0200)]
ospf6d: keep track of the socket set thread

When using the timer to set the socket multicast options, keep track
of the thread pointer. If we lose the thread reference we might have
situations where multicast is enabled when it should be disabled and
vice versa.

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

6 years agoospf6d: don't queue interface events
Rafael Zalamena [Wed, 23 Jan 2019 12:06:49 +0000 (10:06 -0200)]
ospf6d: don't queue interface events

Apply interface event as soon as possible instead of queueing an event
for it.

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

6 years agoMerge pull request #3667 from opensourcerouting/7.0/fix-file-and-syslog
Quentin Young [Thu, 24 Jan 2019 22:10:38 +0000 (17:10 -0500)]
Merge pull request #3667 from opensourcerouting/7.0/fix-file-and-syslog

[7.0] fix "log file" + "log syslog"

6 years agolib: don't disable "log file" on "log syslog"
David Lamparter [Thu, 24 Jan 2019 17:59:03 +0000 (18:59 +0100)]
lib: don't disable "log file" on "log syslog"

FRR log targets are independent, so "log syslog" must not disable
"log file" output.

Fixes: #3551
Fixes: 0204baa87630b210c71d9ae0e2569cff0fb0539b
Signed-off-by: David Lamparter <equinox@diac24.net>
6 years agoMerge pull request #3645 from opensourcerouting/ldpd-pdu-length-fix-7.0
Donald Sharp [Wed, 23 Jan 2019 01:08:48 +0000 (20:08 -0500)]
Merge pull request #3645 from opensourcerouting/ldpd-pdu-length-fix-7.0

[7.0] ldpd: fix corner case in which we wouldn't respect the max pdu length

6 years agoldpd: fix corner case in which we wouldn't respect the max pdu length
Renato Westphal [Tue, 22 Jan 2019 19:50:33 +0000 (17:50 -0200)]
ldpd: fix corner case in which we wouldn't respect the max pdu length

The calculation to know when an LDP PDU went past the maximum
negotiated PDU length was wrong because it wasn't taking the
"Version" and "PDU Length" fields into account (total of four
bytes). Fix this.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agoMerge pull request #3628 from manuhalo/fix_ospf_vl_del_7.0
Donald Sharp [Tue, 22 Jan 2019 14:08:35 +0000 (09:08 -0500)]
Merge pull request #3628 from manuhalo/fix_ospf_vl_del_7.0

[7.0] ospfd: fix no virtual-link cmd

6 years agoMerge pull request #3637 from opensourcerouting/70-fbsd-route-fix
Donald Sharp [Tue, 22 Jan 2019 14:05:50 +0000 (09:05 -0500)]
Merge pull request #3637 from opensourcerouting/70-fbsd-route-fix

7.0: zebra: fix a few problems with routing socket

6 years agozebra: make routing socket debug user friendlier
Rafael Zalamena [Thu, 17 Jan 2019 22:24:31 +0000 (20:24 -0200)]
zebra: make routing socket debug user friendlier

Implement a addrs RTA to string translator to provide more useful
debug output.

Example:

ifam_read_mesg: ifindex 2, ifname em1, ifam_addrs NETMASK,IFP,IFA
  ifam_flags 0x4, addr 2001:db8:1::1/64 broad (unspec) dst (unspec)
  gateway (unspec)

Instead of:

ifam_read_mesg: ifindex 2, ifname em1, ifam_addrs 0x34
  ifam_flags 0x4, addr 2001:db8:1::1/64 broad (unspec) dst (unspec)
  gateway (unspec)

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
6 years agozebra: fix debug messages in ifam_read_mesg
Rafael Zalamena [Thu, 17 Jan 2019 16:37:53 +0000 (14:37 -0200)]
zebra: fix debug messages in ifam_read_mesg

Use the proper address family to convert binary address to string.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
6 years agozebra: fix debug prefix string size
Rafael Zalamena [Thu, 17 Jan 2019 15:15:20 +0000 (13:15 -0200)]
zebra: fix debug prefix string size

`gate_buf` should be big enough to hold IPv6 addresses and `inet_ntop`
should be run in the correct `sockaddr` struct member.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
6 years agozebra: fix debug messages with prefixes
Rafael Zalamena [Thu, 17 Jan 2019 15:12:13 +0000 (13:12 -0200)]
zebra: fix debug messages with prefixes

Debug messages should use `prefix_buf` and `prefix2str` should only be
called once in `kernel_rtm`.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
6 years agozebra: use rta_getattr for NETMASK
Rafael Zalamena [Fri, 18 Jan 2019 20:28:58 +0000 (18:28 -0200)]
zebra: use rta_getattr for NETMASK

IPv6 uses AF_LINK to represent netmasks, this commit unbreaks
`rtm_read_mesg` that was broke on the `rta_get*` refactory.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
6 years agozebra: fix routing socket AF_LINK handling on NETMASK
Rafael Zalamena [Thu, 17 Jan 2019 22:46:11 +0000 (20:46 -0200)]
zebra: fix routing socket AF_LINK handling on NETMASK

IPv6 netmasks use AF_LINK family type and puts the correct amount of
set bits in the data structure. If we only copy the SDL header we
won't get all IPv6 address length, we must copy the whole extension of
the `sockaddr_in6` struct (which is provided in `destlen` parameter).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
6 years agozebra: remove unused functions
Rafael Zalamena [Thu, 17 Jan 2019 15:19:30 +0000 (13:19 -0200)]
zebra: remove unused functions

Remove two unused functions in `zebra/rt_socket.c`.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
6 years agozebra: use proper sockaddr size in kernel_rtm
Rafael Zalamena [Thu, 17 Jan 2019 13:09:09 +0000 (11:09 -0200)]
zebra: use proper sockaddr size in kernel_rtm

`sockaddr` `len` field is the address type size and not the mask length.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
6 years agoMerge pull request #3615 from pguibert6WIND/priorise_default_vrf_configured_v70
Renato Westphal [Fri, 18 Jan 2019 21:42:10 +0000 (19:42 -0200)]
Merge pull request #3615 from pguibert6WIND/priorise_default_vrf_configured_v70

Priorise default vrf configured

6 years agoospfd: fix no virtual-link cmd
Emanuele Di Pascale [Fri, 18 Jan 2019 11:39:28 +0000 (12:39 +0100)]
ospfd: fix no virtual-link cmd

the  command was not checking
correctly in all cases whether the virtual link existed. This caused
bugs in some corner cases, e.g. when two virtual links were created,
one of them was deleted, and the second one was reset with no
authentication - this would instead create a new virtual link with
the area in decimal format.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
6 years agozebra: do not create vrf if name already set to default vrf at startup
Philippe Guibert [Fri, 28 Dec 2018 13:27:45 +0000 (14:27 +0100)]
zebra: do not create vrf if name already set to default vrf at startup

if the default vrf name is manually set, by passing -o parameter to
zebra, then this should be detected when walking the list of netns
available in the system. If a netns called vrf0 is present, then it
should be ignored.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: start the netns notification mechanism after ns initialisation
Philippe Guibert [Fri, 21 Dec 2018 15:25:20 +0000 (16:25 +0100)]
zebra: start the netns notification mechanism after ns initialisation

when zebra is run, by using vrf netns backend mode, then the parser
detector of netns is run before forcing the default vrf to a possible
value. In that case, there is a possibility that the forced '-o' option
will create a second vrf with same name, whereas this option should be
there to uniquely have a default vrf with a value.
To make things consistent, the forced value will be priorised. Then, the
notifier will attempt to create vrf contexts. The expectation is that
the creation will fail, due to an already present vrf with same name.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
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