Commit Graph

29152 Commits

Author SHA1 Message Date
David Lamparter
408ed95ed2 pimd: remove pim_addr_copy
This is not needed, pim_addr can just be assigned as a whole.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17 14:08:32 +01:00
David Lamparter
032a741219 pimd: move & deploy pim_addr_cmp() helper
Comparing `s_addr` isn't cutting it for IPv6 support.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17 14:08:29 +01:00
David Lamparter
2a27f13b21 pimd: move, rename and deploy pim_addr_is_any()
Replaces comparison against INADDR_ANY, so we can do IPv6 too.

(Renamed from "pim_is_addr_any" for "pim_addr_*" naming pattern, and
type fixed to bool.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17 14:03:26 +01:00
David Lamparter
98a81d2bff pimd: remove pim_str_sg_dump()
... and replace with `%pSG` printfrr specifier.  This actually used a
static buffer in the formatting function, so subsequent formatting would
overwrite earlier uses.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17 14:02:18 +01:00
David Lamparter
9bace5c2d3 pimd: remove pim_str_sg_set()
... and replace with `%pSG` printfrr specifier.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17 14:00:04 +01:00
David Lamparter
40a19188d5
Merge pull request #10179 from patrasar/pimv6_northbound 2022-01-17 13:23:21 +01:00
Rafael Zalamena
4e4c027803
Merge pull request #10183 from idryzhov/rework-vrf-rename
*: rework renaming the default VRF
2022-01-17 08:45:12 -03:00
David Lamparter
17a4c65576 zebra: remove netlink buffer size log message
... really not much point in printing this.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17 09:46:19 +01:00
David Lamparter
908e4c85b8 lib: avoid pointless search for built-in IETF YANG
This causes confusing/annoying log messages at startup otherwise:
`YANG model "ietf-inet-types@*" "*@*"not embedded, trying external file`

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17 09:46:15 +01:00
Igor Ryzhov
1f325f8438
Merge pull request #10350 from Drumato/fix-zebra-srv6-segment-routing-block 2022-01-17 06:33:17 +03:00
David Lamparter
28297b1e84 tests: fuzzing target for zlog_5424 code
This just tries logging messages in random ways to allow the fuzzer to
do its thing and try to find weird edge cases.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17 00:39:00 +01:00
David Lamparter
f93640b810 doc: add new RFC5424 & journald logging targets
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17 00:39:00 +01:00
David Lamparter
29bb23de31 lib: autodetect systemd/journald log on stdout
systemd sets up environment variables to allow autodetecting and
switching the log format to journald native.  Make use of that for the
stdout logging target.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17 00:39:00 +01:00
David Lamparter
1c6261a99e lib: RFC5424 & journald extended syslog target
Not much to say here, user docs are coming up in a separate commit.
RFC5424 and (systemd's) journald allow passing structured key-value
data.  This stuffs the metadata we have available into there.

The "does the system syslogd support RFC5424" question is unfortunately
not easily answered, so we can only give an affirmative answer on NetBSD
5.0+ or FreeBSD 12+.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17 00:39:00 +01:00
David Lamparter
603c61656f lib: add frr_early_init hook
To bring up bits that use thread_master before other init happens.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17 00:39:00 +01:00
David Lamparter
d948c317c5 build: check for sendmmsg() and struct mmsghdr
These will be used by the RFC5424 log target.

Signed-off-by: David Lamparter <equinox@diac24.net>
2022-01-17 00:38:56 +01:00
Donatas Abraitis
8c20061f40 bgpd: Add peer-groups to neighbor autocomplete
```
exit1-debian-11(config-router)# neighbor PGTEST peer-group
exit1-debian-11(config-router)# neighbor PEER peer-group
exit1-debian-11(config-router)# neighbor ?
  A.B.C.D   Neighbor address
     192.168.0.2 PEER PGTEST
  WORD      Interface name or neighbor tag
     PEER PGTEST
  X:X::X:X  Neighbor IPv6 address
     2a02🔤:17 2a02:bbd::2 PEER PGTEST
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-16 22:08:57 +02:00
Yamato Sugawara
1b3aea985e zebra: fix segment-routing command not found error with --disable-pathd
Signed-off-by: Yamato Sugawara <yamato.sugawara@linecorp.com>
2022-01-16 21:46:22 +09:00
Igor Ryzhov
3ae667e527
Merge pull request #10349 from anlancs/doc-ospf-no
doc: adjust small words for ospfd
2022-01-16 15:31:04 +03:00
Mobashshera Rasool
3996d25e3c tests: Fix random failure in test_PIM_hello_tx_rx_p1
The test case test_PIM_hello_tx_rx_p1 is failing randomly because
sometimes the hello packet is received and sometimes not received while getting
the stats data.
When the hello packet is received HelloRx gets incremented to 1 and then
shutdown of the interface is executed which resets the stats to 0
and again when "no shutdown" of the interface is done, the stats get incremented to 1.
The test case checks after "no shutdown" of the interface whether the stats is incremented
but in this case although the stats got incremented the before and after value is same.
Hence the test case failed.

Adding correct expectations in the test case.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-01-16 04:00:11 -08:00
anlan_cs
94184417fc doc: adjust small words for ospfd
Signed-off-by: anlan_cs <anlan_cs@tom.com>
2022-01-15 20:38:30 -05:00
David Lamparter
2aa2e59320
Merge pull request #10343 from taspelund/fix_receivedRoutes_string 2022-01-15 17:23:55 +01:00
Renato Westphal
485e8b5662 tests: check if OSPF opaque attributes are installed in the RIB
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2022-01-15 17:22:27 +01:00
Renato Westphal
5b5d66c431 lib, ospfd, ospf6d, zebra: add OSPF opaque route attributes
Update ospfd and ospf6d to send opaque route attributes to
zebra. Those attributes are stored in the RIB and can be viewed
using the "show ip[v6] route" commands (other than that, they are
completely ignored by zebra).

Example:
```
debian# show ip route 192.168.1.0/24
Routing entry for 192.168.1.0/24
  Known via "ospf", distance 110, metric 20, best
  Last update 01:57:08 ago
  * 10.0.1.2, via eth-rt2, weight 1
    OSPF path type        : External-2
    OSPF tag              : 0

debian#
debian# show ip route 192.168.1.0/24 json
{
  "192.168.1.0\/24":[
    {
      "prefix":"192.168.1.0\/24",
      "prefixLen":24,
      "protocol":"ospf",
      "vrfId":0,
      "vrfName":"default",
      "selected":true,
      [snip]
      "ospfPathType":"External-2",
      "ospfTag":"0"
    }
  ]
}
```

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2022-01-15 17:22:27 +01:00
David Lamparter
bf2209ec07
Merge pull request #9695 from yyuanam/second_commit 2022-01-15 17:18:34 +01:00
Donald Sharp
974758676f
Merge pull request #10338 from opensourcerouting/pim6-no-msdp
pim6d: drop off MSDP code
2022-01-15 11:07:44 -05:00
David Lamparter
ae24ca1274
Merge pull request #10346 from donaldsharp/zebra_nht_speedup 2022-01-15 16:07:43 +01:00
Donald Sharp
939e32702a
Merge pull request #10342 from Marlinc/rfc9136
docs(bgp): refer to rfc9136 instead of draft
2022-01-15 07:27:21 -05:00
Trey Aspelund
c1984955b7 bgpd: fix advertisedRoutes json key
'show bgp ... neighbor [routes|received-routes]' both incorrectly
used a json key of 'advertisedRoutes'.
This corrects the key to be 'receivedRoutes' for commands where
the displayed routes were received, not advertised.

before:
unet> r3 show ip bgp neigh 10.2.30.2 received-routes json | include Routes
  "advertisedRoutes":{

after:
ub18# show ip bgp neighbors enp1s0 received-routes json | include Routes
  "receivedRoutes":{
ub18# show ip bgp neighbors enp1s0 advertised-routes json | include Routes
  "advertisedRoutes":{

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2022-01-14 22:03:11 +00:00
David Lamparter
cda1f5e098 pim6d: drop off MSDP code
There is no MSDP for IPv6, so drop this code out of pim6d.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-14 20:32:41 +01:00
Donald Sharp
25c44cf5de
Merge pull request #10339 from opensourcerouting/printfrr-20220114
lib: printfrr shenanigans
2022-01-14 14:15:03 -05:00
Marlin Cremers
d272105aa2 docs(bgp): refer to rfc9136 instead of draft
Instead of referring to the draft of  IP Prefix Advertisement in
Ethernet VPN let's point to the recently published RFC9136.

Signed-off-by: Marlin Cremers <marlin@cbws.nl>
2022-01-14 18:52:30 +01:00
Donald Sharp
cce7c33396
Merge pull request #10335 from ton31337/fix/reduce_nesting_show_neighbor_bgp
bgpd: Reduce nesting for bgp_show_peer()
2022-01-14 08:11:48 -05:00
David Lamparter
54929fd38a *: use semicolon after printfrr_ext_autoreg_{p,d}
Mostly to make clang-format not format these to peak ugly.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-14 13:33:57 +01:00
David Lamparter
f59e688226 lib: add %pTH / %pTHD for printing thread info
Refer to docs in doc/developer for details.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-14 13:33:57 +01:00
David Lamparter
2c76ba433f lib: add time formatting printfrr exts
Refer to docs in doc/developer for details.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-14 13:33:57 +01:00
David Lamparter
2c5b4d80ef lib: add s option to pI4/pI6/pIA printfrr
Adding an `s` after these printfrr specifiers replaces 0.0.0.0 / :: in
the output with a star (`*`).  This is primarily intended for use with
multicast, e.g. to print `(*,G)`.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-14 11:57:46 +01:00
David Lamparter
176b254cb9 tools: disable printf ext checks in checkpatch
checkpatch.pl has a hardcoded list of printf extensions supported... by
the Linux kernel.  This happens to have covered the ones we have in FRR
so far, but `%pPA` isn't on the list and others may not be either.

Since we have the frr-format GCC plugin (and CI runs that on Debian 11)
we don't really need these checks in checkpatch.pl.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-14 09:18:25 +01:00
Sarita Patra
f99f1ff50a zebra: Fix for route node having no tracking NHT
Topology:
IXIA-----(ens192)FRR(ens224)------iXIA

Configuration:
1. Create 8 sub-interfaces on ens192 under Default VRF and configure 8
EBGP session between FRR and IXIA.
2. Create 1000 sub-interfaces on ens224 under Default VRF and configure
1000 EBGP session between FRR and IXIA.
3. 2M prefixes distributed from Left side Ixia each with 8 ECMP path.
4. So in total, there are 2M prefixes * 8 ECMP = 16M prefixes entries
in RIB and FIB.

Issue:
Shut ens192 and ens224, this is taking 1hr 15 mins to clean up the routes.

Root Cause:
In the case of route deletion, if the particular route node is having
nht count = 0, we are going to the parent and doing nht evaluation,
which is not needed.

Fix:
If the deleted the route node is having nht count > 0, then do a nht
evaluation on the parent node.
Shut ens192 and ens224, it is taking 1 min to clean up the routes
with the fix.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-01-13 14:15:05 -05:00
Donald Sharp
a8057c9db5
Merge pull request #10337 from opensourcerouting/clippy-conds
python: pass conditionals through clippy for DEFPY
2022-01-13 13:16:13 -05:00
Igor Ryzhov
18461891d3
Merge pull request #10327 from ton31337/fix/reduce_nested_loops
*: Add FOREACH_AFI_SAFI_NSF(afi, safi) macro to reduce nesting
2022-01-13 20:09:50 +03:00
Donatas Abraitis
107115632a bgpd: Reduce nesting for bgp_show_peer()
It's hard to read sometimes or even add something more.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-13 17:23:03 +02:00
David Lamparter
1c4d0ea4b3
Merge pull request #10279 from SaiGomathiN/pim_intf 2022-01-13 16:13:54 +01:00
David Lamparter
d11238bb5e python: pass conditionals through clippy for DEFPY
Track what conditionals apply when a DEFPY is encountered, and stack
them around the autogenerated clippy wrapper.  Otherwise conditional
DEFPYs result in undefined function warnings.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-13 16:01:53 +01:00
Donald Sharp
acd26def04
Merge pull request #10336 from ton31337/feature/show_gr_llgr_timers_per_neighbor
bgpd: Show Long-lived Graceful Restart seconds remaining per prefix
2022-01-13 09:30:16 -05:00
Donald Sharp
ab0cc8a3f8
Merge pull request #10314 from ckishimo/ospf6d_extstub
ospf6d: do not send Type-5 into stub area
2022-01-13 09:04:35 -05:00
Donald Sharp
21d1ab2dc8
Merge pull request #10324 from anlancs/fix-ospf-stream
lib: fix the right value is returned for fail cases
2022-01-13 09:03:58 -05:00
Donald Sharp
a64abeefdd
Merge pull request #10334 from mobash-rasool/igmp-conf-fix
pimd: IGMP messages may be longer than 8 octets
2022-01-13 09:00:51 -05:00
Donatas Abraitis
df8d723c5f *: Add FOREACH_AFI_SAFI_NSF(afi, safi) macro to reduce nesting
Used for graceful-restart mostly.

Especially for bgp_show_neighbor_graceful_restart_capability_per_afi_safi()

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-13 14:29:54 +02:00
sarita patra
698f414748 pim: Northbound changes accomodating IPV4 address family
frr-pim.yang, created a list of address family under pim
container. For PIMV4 the key is IPV4, where as for PIMV6
the key is IPV6. This is done for PIMV6 development.

This commit will have all the northbound changes to support
IPV4 address family.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-01-13 02:50:49 -08:00