Commit Graph

28014 Commits

Author SHA1 Message Date
Donald Sharp
b22c93996e
Merge pull request #10785 from ton31337/fix/remove_dead_code
bgpd: Remove dead code for [un]register_zebra_rnh
2022-03-12 19:40:52 -05:00
David Lamparter
ccc3ccd38c pim6d: decode IPv6 source addresses
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 22:57:34 +01:00
David Lamparter
042a754146 pim6d: encode PIM joins correctly
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 22:57:34 +01:00
David Lamparter
334326ed39 pim6d: reenable pim_init()
... so we have `qpim_all_pim_routers_addr` initialized.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 22:57:34 +01:00
David Lamparter
185754fe7c pimd: be more informative about missing neighbors
Much more useful to know what we were trying to find a neighbor for.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 22:57:28 +01:00
David Lamparter
516b97fe4d pimd: log interface name for send errors
Not very helpful to be told only the fd number.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 22:57:17 +01:00
David Lamparter
97feb13f0f pim6d: reenable address management code
A few more pieces that should now work reasonably well for IPv6.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 22:47:13 +01:00
David Lamparter
cfef61553f pim6d: rework interface address tracking/selection
We only care about link-local addresses for IPv6 operation.  Also, MLD
needs the lowest while PIM needs the highest...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 22:47:13 +01:00
David Lamparter
cd6d285855 pimd: refactor/split IGMP integration
Try to untangle some spaghetti...

This is an 1:1 change that should not result in any functional
difference.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 22:47:08 +01:00
David Lamparter
d6890c49b2 pimd: add safety check to OIL add/del
These will corrupt memory if mroute_vif_index is -1 (e.g. interface not
operating.)  That shouldn't happen, but it does while doing development
work, so trip an assert rather than corrupting memory.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-12 22:47:08 +01:00
Donald Sharp
e576475723
Merge pull request #10744 from opensourcerouting/igmp-json-leave-typo
pimd: fix typo in IGMP interface statistics JSON output.
2022-03-12 16:09:58 -05:00
Donald Sharp
d7ffe67b0c
Merge pull request #10746 from ton31337/feature/show_group_type_under_rp_info_cli
pimd: Show group-type under `show ip pim rp-info`
2022-03-12 15:28:28 -05:00
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