Commit Graph

29152 Commits

Author SHA1 Message Date
Donatas Abraitis
23f60ffd52 bgpd: Remove dead code for [un]register_zebra_rnh
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-12 21:48:18 +02:00
Donatas Abraitis
3b3b5ab350
Merge pull request #10783 from donaldsharp/bgp_zebra_nht
Bgp zebra nht
2022-03-12 21:46:13 +02:00
Donald Sharp
b74f72c1fb zebra: prefixlen is not afi/safi dependant in encoding nexthops
When encoding a response to the upper level protocol the
prefixlen is not something that needs to be part of the
switch statement for handling of a prefix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-12 11:18:45 -05:00
Donald Sharp
06e4e90132 *: When matching against a nexthop send and process what it matched against
Currently the nexthop tracking code is only sending to the requestor
what it was requested to match against.  When the nexthop tracking
code was simplified to not need an import check and a nexthop check
in b8210849b8 for bgpd.  It was not
noticed that a longer prefix could match but it would be seen
as a match because FRR was not sending up both the resolved
route prefix and the route FRR was asked to match against.

This code change causes the nexthop tracking code to pass
back up the matched requested route (so that the calling
protocol can figure out which one it is being told about )
as well as the actual prefix that was matched to.

Fixes: #10766
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-12 11:18:45 -05:00
David Lamparter
30d408e6c7
Merge pull request #10781 from donaldsharp/remove_unused_function 2022-03-12 16:40:48 +01:00
Balaji Gurudoss
023d3e4af8 pim6d: pim6d socket changes
socket changes to support IPv6 PIM

Signed-off-by: Balaji Gurudoss <G_Balaji1@dell.com>
[DL: cleaned up & refactored a whole bunch more.]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 15:59:01 +01:00
Donald Sharp
5c7861fe35 zebra: Remove unused ZEBRA_NHT_EXACT_MATCH
This usage was removed in an earlier bit of code
do some final cleanup

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-12 08:27:22 -05:00
Donald Sharp
58c05959d5 bgpd, lib, pimd: Remove sockopt_cork
sockopt_cork is a no-op function that was cleaned up
in 2017.  Since then it's still not being used.  At
this point in time there is little point in keeping a
dead function that will not be used because of vagaries
between platforms

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-12 08:21:16 -05:00
Donald Sharp
6aa54b144a
Merge pull request #10780 from mobash-rasool/fixes
pimd: Fix Null pointer dereference
2022-03-12 08:07:50 -05:00
David Lamparter
99eba3098c doc/developer: remove outdated paragraph
We have `_anywhere` and `_member` now, so this has become outdated.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 13:23:36 +01:00
David Lamparter
627198d18c doc/developer: reword list -> container
For some reason I couldn't think of the word "container" back when I
wrote most of this.  It is the proper term most developers wil
understand correctly, so let's use it.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 13:23:36 +01:00
David Lamparter
643ea83be2 lib: add _last and _prev on typesafe RB/DLIST
RB-tree and double-linked-list easily support backwards iteration, and
an use case seems to have popped up.  Let's make it accessible.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 13:23:36 +01:00
David Lamparter
c532e50351 pimd: drop printing IP_MULTICAST_LOOP sockopt
This isn't a system or interface setting, it's a socket behavior.  It is
both irrelevant and confusing to the user since it doesn't affect any
system behavior (but it sounds like it does).  Whether it is enabled or
not is solely relevant to how the code is designed to work.

So, remove it from output.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 12:55:12 +01:00
Donatas Abraitis
4778843161
Merge pull request #10778 from donaldsharp/command_logging
tests: Make all commands logged
2022-03-12 10:43:57 +02:00
Donatas Abraitis
8c0a76808a pimd: Show group-type under show ip pim rp-info
And filter by group for PIM.

```
exit1-debian-11# show ip pim rp-info
RP address       group/prefix-list   OIF               I am RP    Source   Group-Type
192.168.10.17    238.0.0.0/24        eth2              no         Static   ASM
192.168.10.110   232.0.0.0/24        eth2              no         Static   SSM
exit1-debian-11# show ip pim rp-info 238.0.0.0/24
RP address       group/prefix-list   OIF               I am RP    Source   Group-Type
192.168.10.17    238.0.0.0/24        eth2              no         Static   ASM
exit1-debian-11# show ip pim rp-info 238.0.0.0/24 json
{
  "192.168.10.17":[
    {
      "rpAddress":"192.168.10.17",
      "outboundInterface":"eth2",
      "iAmRP":false,
      "group":"238.0.0.0/24",
      "source":"Static",
      "groupType":"ASM"
    }
  ]
}
exit1-debian-11#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-12 10:41:07 +02:00
anlan_cs
df44783078 zebra: use "assert" instead of unnecessary check
Since `zvni_map_to_svi_ns()` is used to find and return one specific interface
based on passed attributes of SVI, so the two parameters `in_param` and `p_ifp`
must not be NULL.

Passing NULL `p_ifp` makes no sense, so the check `if (p_ifp)` is
unnecessary.

So use `assert` to ensure the two parameters, and remove that unnecessary check.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-03-12 12:44:47 +08:00
Donald Sharp
44f1c44c2d
Merge pull request #10759 from opensourcerouting/feature/add_more_stats_for_igmp
pimd: Add IGMP total groups and total source groups to statistics
2022-03-11 14:32:05 -05:00
Donald Sharp
dbaa656ace
Merge pull request #10727 from ton31337/feature/adjust_release_doc
doc: Add a couple of handy commands to get some info for release notes
2022-03-11 14:29:46 -05:00
Donald Sharp
04442fdbea zebra: Add ECMP supported to show zebra
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-11 14:25:23 -05:00
Donald Sharp
e92508a741 lib: Convert prefix_master->str to a RB Tree
The prefix_master->str data structure was a sorted
list of the prefix names.  Not that big of a deal
other than insertion and deletion is insanely expensive
when you have a large number of unique prefix-lists.

In my test config file that I discovered this,
I have 587 unique prefix lists spread out acros
~26k lines of prefix-lists.  When reading
this config file into FRR the read time goes
from 690 seconds to 650 seconds.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-11 14:18:13 -05:00
Donald Sharp
89ee4bbb21
Merge pull request #10774 from opensourcerouting/pim6-fixes-20220311
pim6d: fix a bunch of IPv6 confusion
2022-03-11 14:12:58 -05:00
Sri Mohana Singamsetty
1b387a2894
Merge pull request #10711 from anlancs/zebra-remove-flag
zebra: remove unnecessary assignment
2022-03-11 11:08:51 -08:00
Mobashshera Rasool
ea5f4c4c57 pimd: Fix Null pointer dereferences
Fixing the below problem:
Dereferencing a pointer that might be "NULL" "group_dnode"
when calling "yang_is_last_list_dnode" in api pim_process_no_rp_cmd

Although there is no NULL pointer dereference since
yang_dnode_exists is called before using the dnode.
So removing the unnecessary yang_dnode_exists api call
and directly get the node and if node does not exists,
return.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-11 10:07:01 -08:00
Donald Sharp
a7c0a04f09 tests: Make all commands logged
Do not allow the test system to turn off the logging of commands
Some tests use the reload command that is accidently turning off
the logging.  Just force the tests to ignore it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-11 11:19:29 -05:00
David Lamparter
737d8a8dd1
Merge pull request #10776 from donaldsharp/vrrp_compile 2022-03-11 16:29:27 +01:00
Jafar Al-Gharaibeh
9d888674b2
Merge pull request #10767 from donaldsharp/some_fixes
bgpd: Do not fail when going from GR mode to GR
2022-03-11 08:50:28 -06:00
Donald Sharp
542e7df63e vrrpd: Allow it to be built in directory
Looks like the bones were put in place but they
were slightly malformed.  Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-11 07:49:03 -05:00
David Lamparter
41490e0ede pim6d: fix some format strings for IPv6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-11 13:43:19 +01:00
David Lamparter
5d1d18a10e pim6d: fix some IPv6 confusion in RP code
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-11 13:43:19 +01:00
David Lamparter
243e02abae pimd: RP code indentation adjustment
Need to fix some bits here and running into the "80-ch wall".

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-11 13:43:19 +01:00
David Lamparter
543a26848d lib: add %pFXh to print prefix w/o prefixlen
Mostly for pimd, for the time being.  May be removed again if unused.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-11 13:43:19 +01:00
David Lamparter
424ec38499 lib: add JSON printfrr dict-key helper
`json_object_object_add()` adds keys/items to objects/dictionaries.
Useful to have a printfrr based variant for the key there.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-11 13:43:00 +01:00
David Lamparter
64fac7801c
Merge pull request #10743 from donaldsharp/bgp_no_ll 2022-03-11 10:43:58 +01:00
David Lamparter
97f4bf8095
Merge pull request #10480 from mobash-rasool/pimv6-doc 2022-03-11 10:41:40 +01:00
Chirag Shah
b27be4dbd7 zebra: evpn disable remove l2vni from l3vni list
Upon 'no advertise-all-vni', cleanup l2vni from
its tenant-vrf's l3vni list, instead of passed
zvrf->l3vni which will not be present in case
of default instance.

Reviewed By:
Testing Done:
Before Fix:
----------
TORC12(config-router-af)# advertise-all-vni
TORC12(config-router-af)# end
TORC12# show evpn vni 4001
VNI: 4001
  Type: L3
  Tenant VRF: vrf1
  Vxlan-Intf: vni4001
  State: Up
  Router MAC: 44:38:39:ff:ff:01
  L2 VNIs: 134217728 0 1000 1002 <-----

After Fix:
----------
TORC12# show evpn vni 4001
VNI: 4001
  Type: L3
  Tenant VRF: vrf1
  Vxlan-Intf: vni4001
  State: Up
  Router MAC: 44:38:39:ff:ff:01
  L2 VNIs: 1000 1002

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2022-03-10 19:59:33 -08:00
Chirag Shah
3d43b95ce1 zebra: cleanup host prefix from rmac
Ticket:#2798406
Testing Done:

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2022-03-10 17:27:15 -08:00
Chirag Shah
4a8e182a66 zebra: print rmac nexthop list
Ticket:#2798406
Reviewed By:
Testing Done:

Before change:
--------------

TORS1# show evpn rmac vni 4001 mac  44:38:39:ff:ff:01
MAC: 44:38:39:ff:ff:01
 Remote VTEP: 36.0.0.11
 Refcount: 1
  Prefixes:
    [1]:[00:00:00:00:00:00:00:00:00:00]:[::]/352
TORS1#
TORS1# show evpn rmac vni 4001 mac 44:38:39:ff:ff:01 json
{
  "routerMac":"44:38:39:ff:ff:01",
  "vtepIp":"36.0.0.11",
  "refCount":1,
  "localSequence":0,
  "remoteSequence":0,
  "prefixList":[
    "[1]:[00:00:00:00:00:00:00:00:00:00]:[::]\/352"
  ]
}

After change:
-------------

TORS1# show evpn rmac vni 4001 mac 44:38:39:ff:ff:01
MAC: 44:38:39:ff:ff:01
 Remote VTEP: 36.0.0.11
 Refcount: 0
  Prefixes:
TORS1#
TORS1# show evpn rmac vni 4001 mac 44:38:39:ff:ff:01 json
{
  "routerMac":"44:38:39:ff:ff:01",
  "vtepIp":"36.0.0.11",
  "nexthops":[
    "36.0.0.11"
  ]
}

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2022-03-10 17:27:15 -08:00
Chirag Shah
ae9e6beaea zebra: remove host prefix mapping in rmac
RMAC keeping list of nexthops to keep track
of its existiance, remove the (old way) host prefix
mapping.

Ticket: #2798406
Reviewed By:
Testing Done:

TORS1# show evpn rmac vni 4001 mac  44:38:39:ff:ff:01
MAC: 44:38:39:ff:ff:01
 Remote VTEP: 36.0.0.11
  Refcount: 0
    Prefixes:

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2022-03-10 17:27:15 -08:00
Chirag Shah
db88997872 zebra: maintain list of nhs in rmac db
Keep the list of remote-vteps/nexthops in
rmac db.

Problem:
In CLAG deployment there might be a situation
where CLAG secondary sends individual ip as nexthop
along with anycast mac as RMAC. This combination
is updated in zebra's rmac cache.
Upon recovery at clag secondary sends withdrawal
of the incorrect rmac and nexthop mapping.
The RMAC entry mapping to nh is not cleaned up properly
in the zebra rmac cache.

Fix:
Zebra rmac db needs to maintain a list of nexthops.
When a bgp withdrawal for rmac to nexthop mapping
is received, remove the old nexthop from the rmac's nh
list and if the host reference still remains for
the RMAC,fall back to the nexthop one remaining in
the list.
At most you expect two nexthops mapped to RMAC
(in clag deployment).

Ticket: 2798406
Reviewed By:
Testing Done:

CLAG primary and secondary have advertise-pip enabled
advertise type-5 route (default route) with
individual IP as nh and individual svi mac as rmac.

- disable advertise pip on both clag devices, this
results in advertisement of routes with anycast ip as nh
and anycast mac as rmac.

- disable peerlink on clag primary, this triggers
clag secondary to (transitory) send bgp update with
individual ip as nh and anycast mac as rmac.

- At the remote vtep:
Check the zebra's rmac cache/nh mapping correctly
and points to anycast rmac and anycast ip as nh of the
clag system.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2022-03-10 17:27:15 -08:00
Donald Sharp
37a9cb28ab
Merge pull request #10749 from opensourcerouting/live-log-polish
lib, vtysh: apply some polish to live-log feature
2022-03-10 19:41:48 -05:00
Donald Sharp
43a10ccd3a
Merge pull request #10764 from ton31337/fix/add_missing_new_line_for_cli
ospfd,ospf6d: Add missing newline for `graceful-restart prepare` CLI
2022-03-10 19:33:02 -05:00
David Lamparter
f1bfeadcc1
Merge pull request #10707 from mobash-rasool/pimv6-register-recv 2022-03-10 19:00:45 +01:00
Donald Sharp
6240377270 bgpd: Do not fail when going from GR mode to GR
If you enter:

router bgp 325
  bgp graceful-restart
  bgp graceful-restart
!

The second command entered will fail.  This is not
something that should be failing as that it's a no-op.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-10 09:33:57 -05:00
Mobashshera Rasool
e782863dfc pim6d: Replace pim_br_unknown with PIMADDR_ANY
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-10 03:24:52 -08:00
Mobashshera Rasool
a141ea61e7 pim6d: Handle B bit changes for IPv6
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-10 03:24:52 -08:00
Mobashshera Rasool
c7842d245e pim6d: Parsing pimv6 register msg
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-10 03:24:46 -08:00
Mobashshera Rasool
d1fd950aa0 pim6d: Abstract api to get src and dst from ip hdr
IPv4 uses "struct ip" and IPv6 uses "struct ip6_hdr" as
headers. Get the src and dst in pim_sgaddr.
Added api pim_sgaddr_from_iphdr to do so.

Signed-off-by: Mobashshera Rasool <mrasool@vmwaer.com>
2022-03-10 03:01:47 -08:00
Mobashshera Rasool
829ab02106 doc: Add the document for PIMv6
This PR is raised to add the documentation for MLD and PIMv6.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-10 02:12:54 -08:00
Stephen Worley
47c1d76a6c zebra: cleanup protodown netlink logs
Cleanup the logs in the netlink code for setting
protodown on/off to be more useful to a user parsing them
after an issue.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:45 -05:00
Stephen Worley
7140b00cb0 zebra: use SET/UNSET/CHECK/COND in protodown code
Use the SET/UNSET/CHECK/COND macros for flag bifields
where appropriate throught the protodown code base.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-03-09 18:02:44 -05:00