Commit Graph

28014 Commits

Author SHA1 Message Date
ckishimo
3cd5108d82 ospf6d: fix NSSA area-range command
When an area-range command is applied in an ABR, the more specific prefixes
need to be removed.

r2# sh ipv6 ospf database

        AS Scoped Link State Database

Type LSId           AdvRouter       Age   SeqNum                        Payload
ASE  0.0.0.1        10.254.254.2     53 80000001                             ::
ASE  0.0.0.2        10.254.254.2     51 80000001                2001:db8:1::/64
ASE  0.0.0.3        10.254.254.2     51 80000001                2001:db8:3::/64
ASE  0.0.0.4        10.254.254.2     51 80000001                2001:db8:2::/64
ASE  0.0.0.5        10.254.254.2     46 80000001                2001:db8:1::/64
ASE  0.0.0.6        10.254.254.2     46 80000001                2001:db8:3::/64
ASE  0.0.0.7        10.254.254.2     46 80000001                2001:db8:2::/64
ASE  0.0.0.8        10.254.254.2     41 80000001                2001:db8:3::/64
ASE  0.0.0.9        10.254.254.2     41 80000001           2001:db8:1000::1/128  <-- **
ASE  0.0.0.10       10.254.254.2     41 80000001           2001:db8:1000::2/128  <-- **
ASE  0.0.0.12       10.254.254.2     24 80000001             2001:db8:1000::/64
ASE  0.0.0.1        10.254.254.3     52 80000001                2001:db8:2::/64

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-03-28 22:19:27 +02:00
David Lamparter
e7485deb0a pim6d: box out IPv4 fragmentation code
... this shouldn't run for IPv6.  (We'll switch to not using
IPV6_HDRINCL later, so the kernel will handle it, but for the time being
let's just stop trying to use the IPv4 code for IPv6.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-28 17:59:16 +02:00
Donald Sharp
a80d833f6b
Merge pull request #10878 from ton31337/fix/bgp_crash_vrf_all_all
bgpd: Fix crash for `show ip bgp vrf all all`
2022-03-28 08:27:19 -04:00
Donald Sharp
80e39114b5
Merge pull request #10897 from opensourcerouting/safi-nht
zebra,staticd,*: SAFI_MULTICAST NHT groundwork
2022-03-28 08:23:36 -04:00
David Lamparter
721c7be3b2 pim6d: include IPv6 pseudoheader in RX checksums
A lot simpler than the TX code.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-28 14:13:23 +02:00
David Lamparter
145e4c38b9 pim6d: include IPv6 pseudoheader in TX checksums
Lots of passing src/dst around, but it is what it is.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-28 14:13:23 +02:00
David Lamparter
b6d9ad298d pim6d: reenable socket functions
pim_sock_*() functions are adapted for IPv6 now, reenable calling them.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-28 14:13:23 +02:00
David Lamparter
cc362d24aa pim6d: send PIM packets
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-28 14:13:22 +02:00
David Lamparter
7993f685c1
Merge pull request #10661 from plsaranya/pim6_msg 2022-03-28 14:04:44 +02:00
Donatas Abraitis
0d4532cd82 bgpd: Stop LLGR timer when the connection is established
When the connection goes up, the timer is not stopped and if we have a
subsequent GR event we have an old timer which is not as we expect.

Before:
```
spine1-debian-11# sh ip bgp 192.168.100.1/32
BGP routing table entry for 192.168.100.1/32, version 95
Paths: (1 available, best #1, table default, mark routes to be retained for a longer time. Requires support for Long-lived BGP Graceful Restart)
  Not advertised to any peer
  65001 47583, (stale)
    192.168.0.1 from 192.168.0.1 (100.100.200.100)
      Origin incomplete, valid, external, best (First path received)
      Community: llgr-stale
      Last update: Mon Mar 28 08:27:53 2022
      Time until Long-lived stale route deleted: 23 <<<<<<<<<<<<

spine1-debian-11# sh ip bgp 192.168.100.1/32
BGP routing table entry for 192.168.100.1/32, version 103
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  192.168.0.1
  65001 47583
    192.168.0.1 from 192.168.0.1 (100.100.200.100)
      Origin incomplete, valid, external, best (First path received)
      Last update: Mon Mar 28 08:43:29 2022

spine1-debian-11# sh ip bgp 192.168.100.1/32
BGP routing table entry for 192.168.100.1/32, version 103
Paths: (1 available, best #1, table default, mark routes to be retained for a longer time. Requires support for Long-lived BGP Graceful Restart)
  Not advertised to any peer
  65001 47583, (stale)
    192.168.0.1 from 192.168.0.1 (100.100.200.100)
      Origin incomplete, valid, external, best (First path received)
      Community: llgr-stale
      Last update: Mon Mar 28 08:43:30 2022
      Time until Long-lived stale route deleted: 17 <<<<<<<<<<<<<<<
```

After:
```
spine1-debian-11# sh ip bgp 192.168.100.1/32
BGP routing table entry for 192.168.100.1/32, version 79
Paths: (1 available, best #1, table default, mark routes to be retained for a longer time. Requires support for Long-lived BGP Graceful Restart)
  Not advertised to any peer
  65001 47583, (stale)
    192.168.0.1 from 192.168.0.1 (0.0.0.0)
      Origin incomplete, valid, external, best (First path received)
      Community: llgr-stale
      Last update: Mon Mar 28 09:05:18 2022
      Time until Long-lived stale route deleted: 24 <<<<<<<<<<<<<<<

spine1-debian-11# sh ip bgp 192.168.100.1/32
BGP routing table entry for 192.168.100.1/32, version 87
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  192.168.0.1
  65001 47583
    192.168.0.1 from 192.168.0.1 (100.100.200.100)
      Origin incomplete, valid, external, best (First path received)
      Last update: Mon Mar 28 09:05:25 2022

spine1-debian-11# sh ip bgp 192.168.100.1/32
BGP routing table entry for 192.168.100.1/32, version 87
Paths: (1 available, best #1, table default, mark routes to be retained for a longer time. Requires support for Long-lived BGP Graceful Restart)
  Not advertised to any peer
  65001 47583, (stale)
    192.168.0.1 from 192.168.0.1 (100.100.200.100)
      Origin incomplete, valid, external, best (First path received)
      Community: llgr-stale
      Last update: Mon Mar 28 09:05:29 2022
      Time until Long-lived stale route deleted: 29 <<<<<<<<<<<<<<
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-28 13:26:09 +03:00
Mobashshera Rasool
ec6ac9b197 pim6d: Correct the show ip prefix-list display for pim6d
Currently the PIM6d component is getting displayed under
"show ip prefix-list" instead of "show ipv6 prefix-list".
Fixed it.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-28 03:23:48 -07:00
mobash-rasool
f0a7100770
Merge pull request #10905 from opensourcerouting/fix/BGP_PREFIX_SID_SRV6_L3_SERVICE_SID_STRUCTURE_LENGTH
bgpd: Fix mixed print types for BGP_PREFIX_SID_SRV6_L3_SERVICE_SID_ST…
2022-03-28 15:52:30 +05:30
Nobuhiro MIKI
fbd01eaa41 zebra: output optional param "func-bits" for SRv6
Signed-off-by: Nobuhiro MIKI <nmiki@yahoo-corp.jp>
2022-03-28 17:37:45 +09:00
Donatas Abraitis
c5fa4459f4 bgpd: Fix mixed print types for BGP_PREFIX_SID_SRV6_L3_SERVICE_SID_STRUCTURE_LENGTH
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-28 11:08:33 +03:00
David Lamparter
da4d4d7b39
Merge pull request #10366 from AbhishekNR/mld_cli 2022-03-28 09:18:36 +02:00
Donatas Abraitis
4ffc9d0f26
Merge pull request #10883 from donaldsharp/bgp_evpn_stream_read
bgpd: Fix possible insufficient stream data
2022-03-28 09:04:55 +03:00
Donatas Abraitis
fd5697e356
Merge pull request #10887 from donaldsharp/dump_it
zebra: Note when the netlink DUMP command is interrupted
2022-03-28 09:02:24 +03:00
Nobuhiro MIKI
5a22d2ad33 zebra: fix typo in doc/user/zebra.rst
Signed-off-by: Nobuhiro MIKI <nmiki@yahoo-corp.jp>
2022-03-28 12:13:31 +09:00
David Lamparter
12a0d83c8c pim6d: fix string constant size
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-27 16:18:59 +02:00
David Lamparter
6bcc46657e staticd: track nexthops per-SAFI
This stops intermixing SAFI_UNICAST NHT into SAFI_MULTICAST static
routes.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-27 14:57:22 +02:00
David Lamparter
e203efe87b staticd: use inline prefix in NHT data
No need to waste malloc overhead on this.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-27 14:57:22 +02:00
David Lamparter
50efe4be1f staticd: use typesafe static_nht_hash
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-27 14:57:22 +02:00
David Lamparter
7d08e1e31c zebra: add a few const in RNH code
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-27 14:57:22 +02:00
David Lamparter
eb3c9d9774 *: add SAFI argument to zclient_send_rnh
Just pushing that SAFI_UNICAST up 1 level to the caller.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-27 14:57:22 +02:00
David Lamparter
6c90403bb1 zebra: show ip nht mrib
Prints the SAFI_MULTICAST NHT state in zebra.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-27 14:57:18 +02:00
David Lamparter
e9ac2861e5 zebra: register NHT nexthops with proper SAFI
Just a small puzzle piece missing in zebra SAFI NHT support.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-27 14:51:00 +02:00
David Lamparter
bc9b1cbfae zebra: check other SAFIs when removing gone client
When a client disconnects, we need to check & remove NHT entries for
other SAFIs too.  Otherwise we crash later trying to access stale data.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-27 14:51:00 +02:00
Donald Sharp
47fd8abae1
Merge pull request #10889 from anlancs/bgpd-cleanup-4
bgpd: remove dead code for evpn
2022-03-27 08:15:15 -04:00
Donald Sharp
535e035ed6
Merge pull request #10891 from opensourcerouting/feature/autocomplate_for_bmptagets
bgpd: Add autocomplete for BMP targets
2022-03-27 07:29:21 -04:00
David Lamparter
73fe8d102b
Merge pull request #10894 from donaldsharp/babel_down_up 2022-03-27 10:56:31 +02:00
David Lamparter
eab6d32dfc
Merge pull request #10892 from donaldsharp/seconds 2022-03-27 10:51:38 +02:00
anlan_cs
3b7e8d0f49 bgpd: small simplification for evpn RT commands
Small simplification for evpn RT commands, i.e. both per-VRF
and per-VNI - `bgp_evpn_vrf_rt_cmd` and `bgp_evpn_vni_rt_cmd`.

Just extract the duplicated code as a common code, there are
no functional changes.

Additionally correct one comment for `ecommunity_free()`.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-03-27 13:02:05 +08:00
Donald Sharp
93d9b1afbe babeld: Rehook up interface up events
When babeld was switched over to the zapi
interface up/down callbacks the interface up
event was not properly put back in.

Fixes: #10893
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-26 20:46:36 -04:00
Donald Sharp
bddfc29741 lib: Ensure order of operations is expected with SECONDS
These 3 values:
ONE_DAY_SECOND
ONE_WEEK_SECOND
ONE_YEAR_SECOND

Are defined based upon the number of seconds.  Unfortunately doing math
on these values say something like:

days = t->tv_sec / ONE_DAY_SECOND;

Once you go over about a day causes the order of operations to cause the multiplication
to get messed up:

204		if (!t)
(gdb) n
207		w = d = h = m = ms = 0;
(gdb) set t->tv_sec = ONE_DAY_SECOND + 30
(gdb) n
208		memset(buf, 0, size);
(gdb)
210		us = t->tv_usec;
(gdb)
211		if (us >= 1000) {
(gdb)
212			ms = us / 1000;
(gdb)
213			us %= 1000;
(gdb)
217		if (ms >= 1000) {
(gdb)
222		if (t->tv_sec > ONE_WEEK_SECOND) {
(gdb)
227		if (t->tv_sec > ONE_DAY_SECOND) {
(gdb)
228			d = t->tv_sec / ONE_DAY_SECOND;
(gdb) n
229			t->tv_sec -= d * ONE_DAY_SECOND;
(gdb) n
232		if (t->tv_sec >= HOUR_IN_SECONDS) {
(gdb) p d
$6 = 2073600
(gdb) p t->tv_sec
$7 = -179158953570
(gdb)

Converting to adding paranthesis around around the ONE_DAY_SECOND causes
the order of operations to work as expected.

Fixes: #10880
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-26 16:20:53 -04:00
Donatas Abraitis
bbd747dff1 bgpd: Add autocomplete for BMP targets
```
spine1-debian-11(config-router)# bmp targets ?
  BMPTARGETS  Name of the BMP target group
     ok test1
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-26 18:41:54 +02:00
Eugene Crosser
8139cc3a6d autoconf: do not .gitignore m4/ax_lua.m4
The file m4/ax_lua.m4 needs to be a part of distribution, but it is not
inluded in the git repository by default becuase .gitignore file has a
wildcard for all *.m4 files, while individual files that must _not_ be
ignored are listed one by one as exceptions. ax_lua.m4 needs to be added
to this list of exceptions too.

One failure scenario is when you put a snapshot of the source tree in a
new git repository (e.g. the one used for a local CI/CD), this file is
not included in the repository, and subsequently build fails.

This commit adds the exception into m4/.gitignore file

Signed-off-by: Eugene Crosser <crosser@average.org>
2022-03-26 15:05:54 +01:00
anlan_cs
e6f88442fe bgpd: remove dead code for evpn
`is_vni_param_configured()` is used to check whether RD/RT
configured for specific evpn vni.

There seems to be no need for this mixed check. No caller for
about 5 years, just remove it.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-03-26 19:48:52 +08:00
Donald Sharp
2f71996a68 zebra: Note when the netlink DUMP command is interrupted
There exists code paths in the linux kernel where a dump command
will be interrupted( I am not sure I understand what this really
means ) and the data sent back from the kernel is wrong or incomplete.

At this point in time I am not 100% certain what should be done, but
let's start noticing that this has happened so we can formulate a plan
or allow the end operator to know bad stuff is a foot at the circle K.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-25 19:08:14 -04:00
Donald Sharp
5bc17d7bd0
Merge pull request #10677 from mobash-rasool/pimv6-receive-pkt
pim6d: Handling of receiving of PIMv6 packets
2022-03-25 14:09:20 -04:00
Francois Dumontet
5e43330e5c ospfd: fix ospf default route wrongly sent back
That commit aim is to fix an invalid behavior when
default-information is activated on ospf router without always option.

Consider an ASBR with:
-one default route coming from ospf,
-and another default route coming from another deaemon (such BGP or static).

When the daemon bgp stops advertising its default route,
-ospf continues to advertise its previous default route (with aging 0),
-this may create default routing loops.

Expected behavior: is to update the removed external default route with
MAXAGING value.
Updating with MAXAGING value will notify the fact the route is currently
invalid. A later removal from ospf external LSA database will be made.

Analysis: all default routes have their type overwritten by a
DEFAULT_ROUTE type. Thus all default routes whatever its origin (ospf,
bgp, static...) is treated in a same way. But this is not pertinent for
ospf originated default routes.

Fix: avoid overwiting of route type when default route is ospf type.

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2022-03-25 15:40:46 +01:00
Philippe Guibert
7bd1ec9490 ospfd: show running-config displays also srgb on some cases
The following configuration:
router ospf
 segment-routing global-block 16000 23999 local-block 1000 2000
!

appears in the 'show running-config' like below:

router ospf
 local-block 1000 2000
!

When there are custom Adjacencies, display the SRGB even if SRGB
has the default settings.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-03-25 15:18:34 +01:00
Philippe Guibert
052a0cd025 ospfd: silently remove prefix sid already stored in config
There is no need to have an interface available to configure
SRGB. Conversely, it should be possible to remove the SRGB
when no interfaces are available.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-03-25 15:18:34 +01:00
Donald Sharp
52093e0f0e
Merge pull request #10861 from opensourcerouting/fix/replace_strings_to_tr
tools: Replace `strings` to `tr` for frrinit.sh
2022-03-25 10:10:24 -04:00
Donald Sharp
a5f711a11a
Merge pull request #10862 from anlancs/zebra-mh-svi-add
zebra: optimization on the mac addition for evpn-mh
2022-03-25 10:09:59 -04:00
Donald Sharp
4d32f5ae8e
Merge pull request #10881 from opensourcerouting/pim6-ssmpingd-formats
pim6d: fix format string mistakes in ssmpingd
2022-03-25 10:06:42 -04:00
Donald Sharp
5ba2ca9191
Merge pull request #10879 from ton31337/fix/bgp_crash_vrf_all_neighbor_advertise
bgpd: Fix crash for `show ip bgp vrf all all neighbors 192.168.0.1 ...`
2022-03-25 09:58:08 -04:00
Donald Sharp
5c111a25d4 bgpd: Fix possible insufficient stream data
When reading the BGP_PREFIX_SID_SRV6_L3_SERVICE_SID_STRUCTURE
it is possible that the length read in the packet is insufficiently
large enough to read a BGP_PREFIX_SID_SRV6_L3_SERVICE_SID_STRUCTURE.
Let's ensure that it is.

Fixes: #10860
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-25 07:44:55 -04:00
David Lamparter
5e6e8a3959 pim6d: IPv6 headers are always stripped on receive
IPV6_HDRINCL is a TX-only option (unlike IP_HDRINCL), so on RX there
never are IPv6 headers to be looked at / skipped over.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-25 04:24:15 -07:00
Mobashshera Rasool
f20d0d7cf2 pim6d: Adjust pim_pkt_dst_addr_ok for PIMv6
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-25 04:24:15 -07:00
Mobashshera Rasool
5e2b203384 pimd: Modify pim_pim_packet api for receiving v6 packets
Modified the pim_pim_packet api for pimv4/v6.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-25 04:24:09 -07:00