]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
2 years agoMerge pull request #10657 from patrasar/pim_remove_in_addr_none
David Lamparter [Wed, 2 Mar 2022 09:42:17 +0000 (10:42 +0100)]
Merge pull request #10657 from patrasar/pim_remove_in_addr_none

[manual merge to edit comment, didn't want to incur another cycle]

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agopimd: fix stray comment referencing INADDR_NONE
David Lamparter [Wed, 2 Mar 2022 09:41:22 +0000 (10:41 +0100)]
pimd: fix stray comment referencing INADDR_NONE

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agoMerge pull request #10684 from mobash-rasool/join-prune
David Lamparter [Wed, 2 Mar 2022 08:29:02 +0000 (09:29 +0100)]
Merge pull request #10684 from mobash-rasool/join-prune

2 years agoMerge pull request #10652 from mobash-rasool/fixes
Jafar Al-Gharaibeh [Tue, 1 Mar 2022 19:31:49 +0000 (13:31 -0600)]
Merge pull request #10652 from mobash-rasool/fixes

pimd: FRR drops IGMP packets for TOS value other than 0XC0

2 years agoMerge pull request #10697 from donaldsharp/free_bsd_clock_gettime
Jafar Al-Gharaibeh [Tue, 1 Mar 2022 18:48:47 +0000 (12:48 -0600)]
Merge pull request #10697 from donaldsharp/free_bsd_clock_gettime

lib: Fix FreeBSD clock_gettime(CLOCK_THREAD_CPUTIME_ID,..) going backā€¦

2 years agopimd: replace inaddr_none with PIMADDR_ANY
sarita patra [Fri, 25 Feb 2022 13:17:08 +0000 (05:17 -0800)]
pimd: replace inaddr_none with PIMADDR_ANY

We can use PIMADDR_ANY instead of INADDR_NONE to initalize rp->rpf_addr
when there is no rp configured for group_all.

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agoMerge pull request #10699 from opensourcerouting/vtysh-live-log-coverity
Mark Stapp [Tue, 1 Mar 2022 17:07:08 +0000 (12:07 -0500)]
Merge pull request #10699 from opensourcerouting/vtysh-live-log-coverity

vtysh: fix coverity issues in live-log code

2 years agovtysh: fix coverity issues in live-log code
David Lamparter [Tue, 1 Mar 2022 15:00:40 +0000 (16:00 +0100)]
vtysh: fix coverity issues in live-log code

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agoMerge pull request #10690 from opensourcerouting/snap-fix-libelf
Donald Sharp [Tue, 1 Mar 2022 14:12:36 +0000 (09:12 -0500)]
Merge pull request #10690 from opensourcerouting/snap-fix-libelf

snapcraft: Add missing libelf-dev build package

2 years agolib: Fix FreeBSD clock_gettime(CLOCK_THREAD_CPUTIME_ID,..) going backwards
Donald Sharp [Tue, 1 Mar 2022 14:02:33 +0000 (09:02 -0500)]
lib: Fix FreeBSD clock_gettime(CLOCK_THREAD_CPUTIME_ID,..) going backwards

On FreeBSD I have noticed that subsuquent calls to clock_gettime(..)
can return an after time that is before first calls value.
This in turn is generating CPU_HOG's because the subtraction
is wrapping into very very large numbers:

2022/02/28 20:12:58 SHARP: [PTDQA-70FG5]     start: 35.741981000  now: 35.740581000
2022/02/28 20:12:58 SHARP: [XK9YH-ZD8FA][EC 100663313] CPU HOG: task zclient_read (800744240) ran for 0ms (cpu time 18446744073709550ms)

(Please note I added the first line of debug to figure this issue out).

I have been asked to open a FreeBSD bug report and have done so.
In the mean time I think that it is important that FRR does
not generate bogus CPU HOG's on FreeBSD ( especially since
this may or may not be easily fixed and FRR has no control
over what version of the operating system, operators are
going to be running with FRR.

So, add a bit of specialized code that checks to see if
the after time in FreeBSD is before the now time in
thread_consumed_time and do some quick manipulations
to not have this issue.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10640 from donaldsharp/thread_timers
David Lamparter [Tue, 1 Mar 2022 10:45:36 +0000 (11:45 +0100)]
Merge pull request #10640 from donaldsharp/thread_timers

2 years agoMerge pull request #10584 from donaldsharp/workflow_modification
David Lamparter [Tue, 1 Mar 2022 10:44:57 +0000 (11:44 +0100)]
Merge pull request #10584 from donaldsharp/workflow_modification

2 years agoMerge pull request #10634 from patrasar/master_pimv6_last_lookup
David Lamparter [Tue, 1 Mar 2022 08:39:52 +0000 (09:39 +0100)]
Merge pull request #10634 from patrasar/master_pimv6_last_lookup

2 years agopim6d: Handling pim_rpf for IPV6
sarita patra [Wed, 23 Feb 2022 13:03:15 +0000 (05:03 -0800)]
pim6d: Handling pim_rpf for IPV6

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agoMerge pull request #10691 from anlancs/bgp-evpn-check
Donatas Abraitis [Tue, 1 Mar 2022 08:13:15 +0000 (10:13 +0200)]
Merge pull request #10691 from anlancs/bgp-evpn-check

bgpd: fix missing name of default vrf

2 years agopim6d: Handling last_lookup in pim_nexthop for IPV6
sarita patra [Thu, 17 Feb 2022 08:08:31 +0000 (00:08 -0800)]
pim6d: Handling last_lookup in pim_nexthop for IPV6

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agosnapcraft: Add missing libelf-dev build package
Martin Winter [Mon, 28 Feb 2022 23:41:29 +0000 (00:41 +0100)]
snapcraft: Add missing libelf-dev build package

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2 years agoMerge pull request #10672 from donaldsharp/bsd_zebra_graceful_restart_cleanup
Jafar Al-Gharaibeh [Mon, 28 Feb 2022 20:57:35 +0000 (14:57 -0600)]
Merge pull request #10672 from donaldsharp/bsd_zebra_graceful_restart_cleanup

Bsd zebra graceful restart cleanup

2 years agoMerge pull request #10683 from donaldsharp/correct_vrf
Jafar Al-Gharaibeh [Mon, 28 Feb 2022 20:47:16 +0000 (14:47 -0600)]
Merge pull request #10683 from donaldsharp/correct_vrf

zebra: Use the routes vrf not the nexthop vrf for route-map application

2 years agoMerge pull request #10682 from mjstapp/fix_zebra_doc
Sri Mohana Singamsetty [Mon, 28 Feb 2022 18:54:31 +0000 (10:54 -0800)]
Merge pull request #10682 from mjstapp/fix_zebra_doc

doc: fix typo in zebra doc

2 years agopimd: Handle pim join/prune recv flow for ipv6
Mobashshera Rasool [Mon, 17 Jan 2022 10:07:39 +0000 (02:07 -0800)]
pimd: Handle pim join/prune recv flow for ipv6

Making the code changes to handle both ipv4 and ipv6 in the same code

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agozebra: Use the routes vrf not the vrf of the nexthop for route-map application
Donald Sharp [Mon, 28 Feb 2022 18:08:01 +0000 (13:08 -0500)]
zebra: Use the routes vrf not the vrf of the nexthop for route-map application

When a end operator is doing cross vrf imports in bgp:

router bgp 3239 vrf FOO
  address-family ipv4 uni
    import vrf BAR
!

and zebra has this configuration:

vrf FOO
  ip protocol bgp route-map EVA
!

The current code in zebra_nhg.c was looking up the vrf of the
nexthop and attempting to apply the ip protocol route-map.

For most people the nexthop vrf and the re vrf are one and the
same so they never see a problem.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10424 from patrasar/master_pimv6_nht
David Lamparter [Mon, 28 Feb 2022 16:50:42 +0000 (17:50 +0100)]
Merge pull request #10424 from patrasar/master_pimv6_nht

2 years agopim6d: pim_nht changes for pimv6
sarita patra [Wed, 16 Feb 2022 12:51:42 +0000 (04:51 -0800)]
pim6d: pim_nht changes for pimv6

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agodoc: fix typo in zebra doc
Mark Stapp [Mon, 28 Feb 2022 16:28:25 +0000 (11:28 -0500)]
doc: fix typo in zebra doc

Fix a typo in the zebra doc file that triggers a warning.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agoMerge pull request #10678 from donaldsharp/staticd_make_check_fix
Jafar Al-Gharaibeh [Mon, 28 Feb 2022 15:40:12 +0000 (09:40 -0600)]
Merge pull request #10678 from donaldsharp/staticd_make_check_fix

staticd: Fix `make check` failures

2 years agoMerge pull request #10668 from Jafaral/frr-conf-topotest
Donald Sharp [Mon, 28 Feb 2022 15:28:10 +0000 (10:28 -0500)]
Merge pull request #10668 from Jafaral/frr-conf-topotest

topotests: add support for frr.conf as a unified config

2 years agoMerge pull request #10667 from donaldsharp/bufsize
David Lamparter [Mon, 28 Feb 2022 14:56:51 +0000 (15:56 +0100)]
Merge pull request #10667 from donaldsharp/bufsize

2 years agoMerge pull request #10627 from ton31337/fix/enforce_using_documentation_prefixes
Russ White [Mon, 28 Feb 2022 14:54:09 +0000 (09:54 -0500)]
Merge pull request #10627 from ton31337/fix/enforce_using_documentation_prefixes

doc: Enforce using IPv4/IPv6 reserved ranges for documentation

2 years agoMerge pull request #10636 from ton31337/fix/use_get_set_for_communities
Russ White [Mon, 28 Feb 2022 14:52:50 +0000 (09:52 -0500)]
Merge pull request #10636 from ton31337/fix/use_get_set_for_communities

bgpd: Reuse get/set helpers for attr->community

2 years agodoc: Update documentation to indicate *BSD struggles
Donald Sharp [Sun, 27 Feb 2022 19:18:09 +0000 (14:18 -0500)]
doc: Update documentation to indicate *BSD struggles

*BSD has some special struggles associated with the graceful
restart code in zebra.  Add a bit of documentation to outline
this problem and how it is solved.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Get zebra graceful restart working when restarting on *BSD
Donald Sharp [Sun, 27 Feb 2022 19:11:13 +0000 (14:11 -0500)]
zebra: Get zebra graceful restart working when restarting on *BSD

Upon restart zebra reads in the kernel state.  Under linux
there is a mechanism to read the route and convert the protocol
to the correct internal FRR protocol to allow the zebra graceful
restart efforts to work properly.

Under *BSD I do not see a mechanism to convey the original FRR
protocol into the kernel and thus back out of it.  Thus when
zebra crashes ( or restarts ) the routes read back in are kernel
routes and are effectively lost to the system and FRR cannot
remove them properly.  Why?  Because FRR see's kernel routes
as routes that it should not own and in general the admin
distance for those routes will be a better one than the
admin distance from a routing protocol.  This is even
worse because when the graceful restart timer pops and rib_sweep
is run, FRR becomes out of sync with the state of the kernel forwarding
on *BSD.

On restart, notice that the route is a self route that there
is no way to know it's originating protocol.  In this case
let's set the protocol to ZEBRA_ROUTE_STATIC and set the admin
distance to 255.

This way when an upper level protocol reinstalls it's route
the general zebra graceful restart code still works.  The
high admin distance allows the code to just work in a way
that is graceful( HA! )

The drawback here is that the route shows up as a static
route for the time the system is doing it's work.  FRR
could introduce *another* route type but this seems like
a bad idea and the STATIC route type is loosely analagous
to the type of route it has become.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Prevent crash if ZEBRA_ROUTE_ALL is used for a route type
Donald Sharp [Sun, 27 Feb 2022 19:00:41 +0000 (14:00 -0500)]
zebra: Prevent crash if ZEBRA_ROUTE_ALL is used for a route type

FRR will crash when the re->type is a ZEBRA_ROUTE_ALL and it
is inserted into the meta-queue.  Let's just put some basic
code in place to prevent a crash from happening.  No routing
protocol should be using ZEBRA_ROUTE_ALL as a value but
bugs do happen.  Let's just accept the weird route type
gracefully and move on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10566 from whichbug/master
Russ White [Mon, 28 Feb 2022 14:44:47 +0000 (09:44 -0500)]
Merge pull request #10566 from whichbug/master

isisd: use base64 to encode the binary data.

2 years agoMerge pull request #10353 from opensourcerouting/vtysh-live-log
Donald Sharp [Mon, 28 Feb 2022 14:43:29 +0000 (09:43 -0500)]
Merge pull request #10353 from opensourcerouting/vtysh-live-log

lib & vtysh: RFC5424 syslog + vtysh live log display

2 years agoMerge pull request #9674 from leonshaw/fix/staticd-nht-reg
Donald Sharp [Mon, 28 Feb 2022 14:05:44 +0000 (09:05 -0500)]
Merge pull request #9674 from leonshaw/fix/staticd-nht-reg

staticd: Don't register existing nexthop to zebra

2 years agostaticd: Fix `make check` failures
Donald Sharp [Mon, 28 Feb 2022 13:18:55 +0000 (08:18 -0500)]
staticd: Fix `make check` failures

Recent commit:
abc246e19345cbd2bc74c7dc50dac0b9cf2addf8

Has broken `make check` with recently new compilers:

/usr/bin/ld: staticd/libstatic.a(static_nb_config.o): warning: relocation against `zebra_ecmp_count' in read-only section `.text'
  CCLD     tests/bgpd/test_peer_attr
  CCLD     tests/bgpd/test_packet
/usr/bin/ld: staticd/libstatic.a(static_zebra.o): in function `static_zebra_capabilities':
/home/sharpd/frr5/staticd/static_zebra.c:208: undefined reference to `zebra_ecmp_count'
/usr/bin/ld: staticd/libstatic.a(static_zebra.o): in function `static_zebra_route_add':
/home/sharpd/frr5/staticd/static_zebra.c:418: undefined reference to `zebra_ecmp_count'
/usr/bin/ld: staticd/libstatic.a(static_nb_config.o): in function `static_nexthop_create':
/home/sharpd/frr5/staticd/static_nb_config.c:174: undefined reference to `zebra_ecmp_count'
/usr/bin/ld: /home/sharpd/frr5/staticd/static_nb_config.c:175: undefined reference to `zebra_ecmp_count'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make: *** [Makefile:8679: tests/lib/test_grpc] Error 1
make: *** Waiting for unfinished jobs....

Essentially the newly introduced variable zebra_ecmp_count is not available in the
libstatic.a compiled and make check has code that compiles against it.

The fix is to just move the variable to the library.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10639 from patrasar/master_pimv6_upstream
David Lamparter [Mon, 28 Feb 2022 13:10:44 +0000 (14:10 +0100)]
Merge pull request #10639 from patrasar/master_pimv6_upstream

2 years agopim6d: Handling IPV6 in pim_upstream
sarita patra [Wed, 23 Feb 2022 13:58:23 +0000 (05:58 -0800)]
pim6d: Handling IPV6 in pim_upstream

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agovtysh: show live log messages
David Lamparter [Fri, 6 Dec 2019 12:48:06 +0000 (13:48 +0100)]
vtysh: show live log messages

https://www.youtube.com/watch?v=8psFQCEgA18

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agoMerge pull request #10664 from opensourcerouting/checksum-iov
Donald Sharp [Mon, 28 Feb 2022 12:28:49 +0000 (07:28 -0500)]
Merge pull request #10664 from opensourcerouting/checksum-iov

lib: make checksum code take iovec for input

2 years agovtysh: use poll/callback-driven readline interface
David Lamparter [Wed, 4 Dec 2019 07:10:42 +0000 (08:10 +0100)]
vtysh: use poll/callback-driven readline interface

Create a thread_master and funnel readline terminal I/O through it.
This allows processing other input in parallel, e.g. log messages.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agovtysh: receive file descriptors from daemons
David Lamparter [Tue, 3 Dec 2019 23:17:50 +0000 (00:17 +0100)]
vtysh: receive file descriptors from daemons

The other half of yielding back a file descriptor from a daemon to
vtysh.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agopython: improve clippy/clidef macro processing
David Lamparter [Sun, 16 Jan 2022 20:43:55 +0000 (21:43 +0100)]
python: improve clippy/clidef macro processing

Process macros from the current file, and warn if something is
redefined (to a different value).

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agolib: implement `terminal monitor` for vtysh
David Lamparter [Wed, 4 Dec 2019 07:10:42 +0000 (08:10 +0100)]
lib: implement `terminal monitor` for vtysh

Adds a new logging target that sends log messages to vtysh.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agolib: allow returning a file descriptor over vtysh
David Lamparter [Tue, 3 Dec 2019 23:17:50 +0000 (00:17 +0100)]
lib: allow returning a file descriptor over vtysh

This adds the plumbing necessary to yield back a file descriptor to
vtysh.  The fd is passed on the command status code bytes through
AF_UNIX SCM_RIGHTS.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agolib: add accessor for raw timestamp in zlog
David Lamparter [Sun, 16 Jan 2022 12:20:50 +0000 (13:20 +0100)]
lib: add accessor for raw timestamp in zlog

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agoMerge pull request #10387 from mobash-rasool/pim-cli-top
David Lamparter [Mon, 28 Feb 2022 12:22:06 +0000 (13:22 +0100)]
Merge pull request #10387 from mobash-rasool/pim-cli-top

2 years agozebra: Limit speed lookup to at most 4 minutes
Donald Sharp [Wed, 23 Feb 2022 15:32:23 +0000 (10:32 -0500)]
zebra: Limit speed lookup to at most 4 minutes

There exists some interface types that are slow on startup
to fully register their link speed.  Especially those that
are working with an asic backend.  The speed_update timer
associated with each interface would keep trying if the
system returned a MAX_UINT32 as the speed.  This speed
means both unknown or there is none under linux.

Since some interface types are slow on startup let's modify
FRR to try for at most 4 minutes and give up trying on those
interfaces where we never get any useful data.

Why 4 minutes?  I wanted to balance the time associated with
slow interfaces coming up with those that will never give us
a value.  So I choose 4 minutes as a good ballpark of time
to keep trying

Why not track all those interfaces and just not attempt to
do the speed lookup?  I would prefer to not keep track of these
as that I do not know all the interface types, nor do I wish
to keep programming as new ones come in.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agotools: Add `show thread timers` to support bundle generation
Donald Sharp [Wed, 23 Feb 2022 15:19:17 +0000 (10:19 -0500)]
tools: Add `show thread timers` to support bundle generation

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agodoc: Add `show thread timers` doc commands
Donald Sharp [Wed, 23 Feb 2022 15:17:30 +0000 (10:17 -0500)]
doc: Add `show thread timers` doc commands

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agolib, vtysh: Add `show thread timers` command
Donald Sharp [Wed, 23 Feb 2022 15:14:53 +0000 (10:14 -0500)]
lib, vtysh: Add `show thread timers` command

Add the ability to inspect the timers and when they will pop
per daemon:

sharpd@eva ~/frr (thread_return_null)> vtysh -c "show thread timers"
Thread timers for zebra:

Showing timers for default
--------------------------
  rtadv_timer                                       00:00:00.520
  if_zebra_speed_update                             00:00:02.745
  if_zebra_speed_update                             00:00:02.745
  if_zebra_speed_update                             00:00:02.745
  if_zebra_speed_update                             00:00:02.745
  if_zebra_speed_update                             00:00:02.745
  if_zebra_speed_update                             00:00:02.745
  if_zebra_speed_update                             00:00:02.746
  if_zebra_speed_update                             00:00:02.744
  if_zebra_speed_update                             00:00:02.745

Showing timers for Zebra dplane thread
--------------------------------------

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agostaticd: Don't register existing nexthop to zebra
Xiao Liang [Mon, 27 Sep 2021 02:23:37 +0000 (10:23 +0800)]
staticd: Don't register existing nexthop to zebra

Zebra sends a nexthop-update message on registeration, which will cause
existing routes to be reconfigured even no changes actually happened.
Don't register the nexthop again if it's already done.

Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
2 years agopim6d: Add ipv6 pim register-suppress-time CLI
Mobashshera Rasool [Wed, 19 Jan 2022 13:50:02 +0000 (05:50 -0800)]
pim6d: Add ipv6 pim register-suppress-time CLI

Adding below CLI for pim6d
[no] ipv6 pim register-suppress-time (1-65535)

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Adding ipv6 pim rp keep-alive-timer
Mobashshera Rasool [Wed, 19 Jan 2022 13:36:05 +0000 (05:36 -0800)]
pim6d: Adding ipv6 pim rp keep-alive-timer

Adding below CLI for pim6d daemon
[no] ipv6 pim rp keep-alive-timer [(1-65535)]

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Adding ipv6 pim keep-alive-timer
Mobashshera Rasool [Wed, 19 Jan 2022 13:27:24 +0000 (05:27 -0800)]
pim6d: Adding ipv6 pim keep-alive-timer

Adding the below CLI for pim6d daemon:
ipv6 pim keep-alive-timer (1-65535)

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Adding ipv6 pim packet CLI
Mobashshera Rasool [Wed, 19 Jan 2022 13:21:20 +0000 (05:21 -0800)]
pim6d: Adding ipv6 pim packet CLI

Adding below CLI for pim6d daemon:
[no] ipv6 pim packet (1-255)

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Adding ipv6 pim spt-switchover CLI
Mobashshera Rasool [Wed, 19 Jan 2022 09:35:35 +0000 (01:35 -0800)]
pim6d: Adding ipv6 pim spt-switchover CLI

Adding the below CLIs for ipv6:
[no] ipv6 pim spt-switchover infinity-and-beyond
[no] ipv6 pim spt-switchover infinity-and-beyond prefix-list WORD

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Implementing join-prune interval CLI
Mobashshera Rasool [Wed, 19 Jan 2022 08:06:41 +0000 (00:06 -0800)]
pim6d: Implementing join-prune interval CLI

Adding "ipv6 pim join-prune interval (1-65535)

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Add FRR_PIM_AF_XPATH_VAL for v4 and v6
Mobashshera Rasool [Thu, 10 Feb 2022 08:18:13 +0000 (00:18 -0800)]
pim6d: Add FRR_PIM_AF_XPATH_VAL for v4 and v6

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopimd: Moving pim_cli_get_vrf_name function to common file
Mobashshera Rasool [Fri, 25 Feb 2022 08:59:14 +0000 (00:59 -0800)]
pimd: Moving pim_cli_get_vrf_name function to common file

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopimd: Adding pim_cmd_common.h and .c
Mobashshera Rasool [Thu, 10 Feb 2022 08:14:41 +0000 (00:14 -0800)]
pimd: Adding pim_cmd_common.h and .c

This is to keep the cmd changes common to v4 and v6 in this file.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopimd: Change the show running commands based on address family
Mobashshera Rasool [Wed, 19 Jan 2022 08:16:03 +0000 (00:16 -0800)]
pimd: Change the show running commands based on address family

Change the show running commands for pimv4 and pimv6 based on the
address family.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopimd: Removing unnecessary #if
Mobashshera Rasool [Thu, 20 Jan 2022 08:58:40 +0000 (00:58 -0800)]
pimd: Removing unnecessary #if

Since pim_cmd.c file is moved to pimv4 make file, therefore
removing #if PIM_IPV !=6.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Adding show running for ipv6 mld commands
Sai Gomathi N [Wed, 19 Jan 2022 13:16:55 +0000 (05:16 -0800)]
pim6d: Adding show running for ipv6 mld commands

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopimd: Moving igmp "show running-config" to a function
Mobashshera Rasool [Fri, 25 Feb 2022 11:01:57 +0000 (03:01 -0800)]
pimd: Moving igmp "show running-config" to a function

Moving the igmp related commands running config to
a new function specific to pimv4.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Adding PIM_AF_NAME "ip" / "ipv6" for "show running-config"
Mobashshera Rasool [Fri, 25 Feb 2022 09:29:29 +0000 (01:29 -0800)]
pim6d: Adding PIM_AF_NAME "ip" / "ipv6" for "show running-config"

Adding PIM_AF_NAME to use in the show running config for both
pimv4 and pimv6 commands.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopimd: Moving ipv4 running-configs to a separate function
Sai Gomathi N [Wed, 19 Jan 2022 13:00:56 +0000 (05:00 -0800)]
pimd: Moving ipv4 running-configs to a separate function

Co-authored-by: Sai Gomathi <nsaogimathi@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopim6d: Adding the base changes
Sai Gomathi N [Tue, 18 Jan 2022 14:36:17 +0000 (06:36 -0800)]
pim6d: Adding the base changes

Adding the file pim6_cmd.h and pim6d_cmd.c as the base changes
for implementing the CLI changes

Removed the pim_cmd_init from the stub file.

Co-authored-by: Sarita Patra <saritap@vmware.com>
Co-authored-by: Abhishek N R <abnr@vmware.com>
Co-authored-by: Sai Gomathi N <nsaigomathi@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agoMerge pull request #10376 from patrasar/master_pimv6_vtysh
David Lamparter [Mon, 28 Feb 2022 09:26:22 +0000 (10:26 +0100)]
Merge pull request #10376 from patrasar/master_pimv6_vtysh

2 years agotopotests: add support for frr.conf as a unified config
Jafar Al-Gharaibeh [Sun, 27 Feb 2022 01:59:48 +0000 (19:59 -0600)]
topotests: add support for frr.conf as a unified config

This PR adds support for configuring topotest routers using a single file.
  instead of:
```
        router.load_config(
    TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
    )
router.load_config(
    TopoRouter.RD_OSPF, os.path.join(CWD, "{}/ospfd.conf".format(rname))
    )
router.load_config(
    TopoRouter.RD_BGP, os.path.join(CWD, "{}/bgpd.conf".format(rname))
    )
```
  you can now do:
```
        router.load_frr_config(
    os.path.join(CWD, "{}/frr.conf".format(rname)),
    [TopoRouter.RD_ZEBRA, TopoRouter.RD_OSPF, TopoRouter.RD_BGP]
    )
```
or just:

```
        router.load_frr_config(os.path.join(CWD, "{}/frr.conf".format(rname)))
```
In this latter case, the daemons list will be inferred from frr.conf file.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2 years agodoc: Document a existing cli for zebra that was missing
Donald Sharp [Sat, 26 Feb 2022 20:45:47 +0000 (15:45 -0500)]
doc: Document a existing cli for zebra that was missing

The -s or --nl-bufsize option was missing, document it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Allow *BSD to specify a receive buffer size
Donald Sharp [Sat, 26 Feb 2022 20:40:15 +0000 (15:40 -0500)]
zebra: Allow *BSD to specify a receive buffer size

End operator is reporting that they are receiving buffer overruns
when attempting to read from the kernel receive socket.  It is
possible to adjust this size to more modern levels especially
for when the system is under load.  Modify the code base
so that *BSD operators can use the zebra `-s XXX` option
to specify a read buffer.

Additionally setup the default receive buffer size on *BSD
to be 128k instead of the 8k so that FRR does not run into
this issue again.

Fixes: #10666
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10669 from anlancs/bgpd-line
Donald Sharp [Sun, 27 Feb 2022 12:43:28 +0000 (07:43 -0500)]
Merge pull request #10669 from anlancs/bgpd-line

*: Add necessary new line for output of vty_out()

2 years ago*: Add necessary new line for output of vty_out()
anlan_cs [Sun, 27 Feb 2022 01:38:29 +0000 (09:38 +0800)]
*: Add necessary new line for output of vty_out()

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agotests: use PRNG in checksum test
David Lamparter [Sat, 26 Feb 2022 14:13:28 +0000 (15:13 +0100)]
tests: use PRNG in checksum test

(And don't try to go beyond fletcher checksum offset special value.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agolib: use iovec for checksum code
David Lamparter [Sat, 26 Feb 2022 12:20:16 +0000 (13:20 +0100)]
lib: use iovec for checksum code

... to allow checksumming noncontiguous blurbs of data.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agolib: guard checksum.h against multiple inclusion
David Lamparter [Sat, 26 Feb 2022 11:02:10 +0000 (12:02 +0100)]
lib: guard checksum.h against multiple inclusion

checksum.h was throwing errors if it ended up included twice.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agoMerge pull request #9947 from mjstapp/mpls_incoming
David Lamparter [Sat, 26 Feb 2022 15:47:08 +0000 (16:47 +0100)]
Merge pull request #9947 from mjstapp/mpls_incoming

2 years agoMerge pull request #10665 from opensourcerouting/pim6-fix-warning
Donald Sharp [Sat, 26 Feb 2022 15:14:29 +0000 (10:14 -0500)]
Merge pull request #10665 from opensourcerouting/pim6-fix-warning

pimd: fix unused variable

2 years agopimd: fix unused variable
David Lamparter [Sat, 26 Feb 2022 14:32:41 +0000 (15:32 +0100)]
pimd: fix unused variable

Fix `-Werror` build.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agoMerge pull request #10400 from opensourcerouting/pim6-compilefix
Donald Sharp [Sat, 26 Feb 2022 13:03:06 +0000 (08:03 -0500)]
Merge pull request #10400 from opensourcerouting/pim6-compilefix

pim6d: get running with ipv6 types throughout

2 years agoMerge pull request #10658 from proelbtn/fix/srv6-l3vpn-transposition
Russ White [Fri, 25 Feb 2022 21:06:47 +0000 (16:06 -0500)]
Merge pull request #10658 from proelbtn/fix/srv6-l3vpn-transposition

bgpd: Change the format of announcement for SRv6 L3VPN

2 years agoMerge pull request #10655 from donaldsharp/timers_warning_when_large
Sri Mohana Singamsetty [Fri, 25 Feb 2022 16:05:45 +0000 (08:05 -0800)]
Merge pull request #10655 from donaldsharp/timers_warning_when_large

lib: Add a Dev catch for when a timer is set for > 1 year

2 years agobgpd: change the treatment for SRv6 routes
Ryoga Saito [Fri, 25 Feb 2022 13:44:07 +0000 (13:44 +0000)]
bgpd: change the treatment for SRv6 routes

This patch adds transpostion_offset and transposition_len to bgp_sid_info,
and transposes SID only at bgp_zebra_announce.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2 years agobgpd: announce locators instead of transposed SIDs
Ryoga Saito [Fri, 25 Feb 2022 13:42:32 +0000 (13:42 +0000)]
bgpd: announce locators instead of transposed SIDs

This patch changes the format of the Prefix-SID advertised by
bgpd. In current implementation, transposed SIDs were
advertised, which caused two problems:

1. bgpd that receives SRv6 L3VPN routes whose SID is
   transposed couldn't put bgp_attr_srv6_l3vpn whose those
   routes together. This leads extra memory consumption.

2. Some implementation will reject a route with transposed SID.
   This will affect interoperability.

For those reasons, in this patch, instead of advertising
transposed SID, we change it to advertise the locator of SID.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2 years agobgpd: update logic to allocate SRv6 locator
Ryoga Saito [Fri, 25 Feb 2022 13:40:28 +0000 (13:40 +0000)]
bgpd: update logic to allocate SRv6 locator

For the later patches, this patch changes the behavior of alloc_new sid
so that bgpd record not only SID for VRF, but also Locator of SID.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2 years agozebra: use dataplane to read interface NETCONF info
Mark Stapp [Thu, 28 Oct 2021 15:23:31 +0000 (11:23 -0400)]
zebra: use dataplane to read interface NETCONF info

Use the dataplane to query and read interface NETCONF data;
add netconf-oriented data to the dplane context object, and
add accessors for it. Add handler for incoming update
processing.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agozebra: add dplane type for NETCONF data
Mark Stapp [Thu, 28 Oct 2021 15:19:32 +0000 (11:19 -0400)]
zebra: add dplane type for NETCONF data

Add a new dplane op for interface NETCONF data; add the new
enum value to several switch statements.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agozebra: avoid default clause in FPM switch
Mark Stapp [Wed, 27 Oct 2021 17:56:06 +0000 (13:56 -0400)]
zebra: avoid default clause in FPM switch

Avoid default clause in a switch in the FPM module that handles
dplane op codes - include all the codes.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agozebra: add xxxNETCONF messages to the netlink BPF filter
Mark Stapp [Mon, 18 Oct 2021 15:55:24 +0000 (11:55 -0400)]
zebra: add xxxNETCONF messages to the netlink BPF filter

Allow self-produced xxxNETCONF netlink messages through the BPF
filter we use. Just like address-configuration actions, we'll
process NETCONF changes in one path, whether the changes were
generated by zebra or by something else in the host OS.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agozebra: add netlink debug dump for netconf messages
Mark Stapp [Fri, 17 Sep 2021 20:38:16 +0000 (16:38 -0400)]
zebra: add netlink debug dump for netconf messages

Add the RTM_NETCONF messages to the detailed netlink message
dump module.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agozebra: include mpls enabled status in interface output
Mark Stapp [Fri, 17 Sep 2021 20:32:27 +0000 (16:32 -0400)]
zebra: include mpls enabled status in interface output

Add mpls status to the zebra interface struct; include mpls
status in show interface output.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agobuild: correct help output about netlink debug
Mark Stapp [Fri, 17 Sep 2021 20:30:23 +0000 (16:30 -0400)]
build: correct help output about netlink debug

The configure flag _disables_ netlink debug; make the help
text match that.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agozebra: Start of work to get data about mpls from kernel
Donald Sharp [Tue, 4 May 2021 12:50:00 +0000 (08:50 -0400)]
zebra: Start of work to get data about mpls from kernel

a) We'll need to pass the info up via some dataplane control method
(This way bsd and linux can both be zebra agnostic of each other)

b) We'll need to modify `struct interface *` to track this data
and when it changes to notify upper level protocols about it.

c) Work is needed to dump the entire mpls state at the start
so we can gather interface state.  This should be done
after interface data gathering from the kernel.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agopim6d: Adding PIMV6 as VTYSH client
sarita patra [Tue, 18 Jan 2022 06:01:18 +0000 (22:01 -0800)]
pim6d: Adding PIMV6 as VTYSH client

Co-authored-by: Mobashshera Rasool <mrasool@vmware.com>
Signed-off-by: sarita patra <saritap@vmware.com>
2 years agolib: Add a Dev catch for when a timer is set for > 1 year
Donald Sharp [Fri, 25 Feb 2022 13:19:07 +0000 (08:19 -0500)]
lib: Add a Dev catch for when a timer is set for > 1 year

Since there are timers that are created based upon doing some
math and we know that unsigned values when doing math and we accidently
subtract a larger number from a smaller number causes the unsigned
number to wrap to very large numbers, let's put in a small catch
in place to see if there are any places in the system that
mistakes are made and FRR is accidently creating a problem
for itself.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Reuse get/set helpers for attr->community
Donatas Abraitis [Wed, 23 Feb 2022 07:05:47 +0000 (09:05 +0200)]
bgpd: Reuse get/set helpers for attr->community

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agodoc: Enforce using IPv4/IPv6 reserved ranges for documentation
Donatas Abraitis [Mon, 21 Feb 2022 08:08:21 +0000 (10:08 +0200)]
doc: Enforce using IPv4/IPv6 reserved ranges for documentation

Just to avoid publicly IPv4/IPv6 ranges in topotests/documentation.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agopimd: FRR drops IGMP packets for TOS value other than 0XC0
Mobashshera Rasool [Fri, 25 Feb 2022 06:10:52 +0000 (22:10 -0800)]
pimd: FRR drops IGMP packets for TOS value other than 0XC0

Currently the code is expecting the TOS value for received
packet to be 0xC0 and hence it is discarding packets having
TOS value other than 0xc0.

We need to make sure that we are sending the packet with
TOS 0xC0 and while receiving we can allow any TOS value.
Let's follow Postel's law.
Checked Cisco behavior as well. It also accepts all TOS values.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>