Commit graph

31591 commits

Author SHA1 Message Date
Christian Hopps 960ab543cf style: add format checker config that matches FRR style standards
Also move .dir-locals.el to a sample file. This file should not be
in the repository as it affects the user's ability to modify it.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-18 05:18:26 -04:00
mobash-rasool 74aad5ab55
Merge pull request #13319 from anlancs/pimd-wrong-comment-nht
pimd: Correct the wrong comment
2023-04-18 00:07:04 +05:30
Donald Sharp eda79af4a4
Merge pull request #13230 from LabNConsulting/micronet-is-munet
Micronet is munet
2023-04-17 13:35:29 -04:00
Donatas Abraitis eb8bd50b71
Merge pull request #13321 from louis-6wind/doc-affinitymap
doc: include affinity-maps into index
2023-04-17 15:40:19 +03:00
Donatas Abraitis 89618e7e5e
Merge pull request #13320 from LabNConsulting/fix-show-opdata-command
Fix show opdata command
2023-04-17 14:51:38 +03:00
Louis Scalbert 714f05217b doc: include affinity-maps into index
Include affinity-maps documentation into index under "basics".

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-17 11:25:25 +02:00
Donatas Abraitis e7fd314f06
Merge pull request #12550 from AbhishekNR/mld_join
pim6d: Implementing "ipv6 mld join"
2023-04-17 11:01:21 +03:00
Donatas Abraitis bcb1314fc6
Merge pull request #13318 from chiragshah6/fdev1
bgpd: EVPN MH add correct value into dfAlgorithm json output
2023-04-17 09:55:58 +03:00
Christian Hopps 9b3fd1ef69 tests: use a more specific xpath for finding the route JSON data
Rather than requesting the data for the entire model, just request the route
data for the specific prefix. This also tests the xpath code (which was
previously broken).

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-17 02:18:56 -04:00
Christian Hopps b5c12fb1f1 tests: use shlex.quote to pass command arg to vtysh
This makes sure any included quotation is properly escaped and passed
through to vtysh.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-17 02:15:32 -04:00
Christian Hopps b70b22af95 tests: quick fix for --gdb-daemons=DAEMONLIST not working
When launching the daemons under gdb it takes a bit for them to come up, the
currently code only looks for pid files to determine if the daemon is running.
This test is no good as these files are left around by previous runs.

For now do a simple sleep when debugging with gdb to get things working.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-17 02:15:32 -04:00
Christian Hopps e01ecbe194 lib: always check for error, don't count on dnode being NULL
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-17 02:15:32 -04:00
Christian Hopps d249d7e0ab lib: always return valid data format for show yang command.
For JSON return `{}` for XPath return an XML comment `<!-- Not found -->`

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-17 02:15:32 -04:00
Christian Hopps 4ac51e2430 lib: fix broken "show yang operational-data" functionality
Previously was using an API that returned the root of the data tree given the
users input xpath value, and then used it like it was the leaf node (last not
first). So basically this CLI command only worked when one requested the root
node of the model.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-17 01:43:48 -04:00
Christian Hopps 9e0241c8fb lib: add and use new yang function for finding schema nodes
Add a wrapper around lys_find_xpath which has an unfortunate API
returning an allocated set of schema nodes when we only ever expect and
want one.

Another libyang function `lys_find_path` returns a single node; however,
that function can assert/abort on invalid path values so is unsuitable
for user input.

Replace previous uses of `lys_find_path` with new API when dealing with
possible invalid path values (i.e., from a user).

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-17 01:43:48 -04:00
anlan_cs 3d8814f827 pimd: Correct the wrong comment
Currently the function `pim_parse_nexthop_update()` clearly
updates nexthop interfaces even as PIM-disabled.

Just correct the wrong comments about those PIM-disabled interfaces
to avoid misleading.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-04-17 09:07:37 +08:00
Donatas Abraitis eee1fca3eb
Merge pull request #13141 from mjstapp/fix_ospf_json_keys
ospfd: remove deprecated json attrs for neighbor show
2023-04-16 21:33:20 +03:00
Sindhu Parvathi Gopinathan 75ce7c815f bgpd:add correct value into dfAlgorithm json output
FRR "show bgp l2 evpn es <esi-id> json" output shows 'dfAlgorithm'
same as 'dfPreference' value instead of algorithm.

Modified the code to set the correct DF algorithm value into
'dfAlgorithm' field.

torm-11# show bgp l2 evpn es
ES Flags: B - bypass, L local, R remote, I inconsistent
VTEP Flags: E ESR/Type-4, A active nexthop
ESI                            Flags RD                    #VNIs
VTEPs
03:44:38:39:ff:ff:01:00:00:01  LR    27.0.0.15:15          10
27.0.0.16(EA),27.0.0.17(EA)
03:44:38:39:ff:ff:01:00:00:02  LR    27.0.0.15:16          10
27.0.0.16(EA),27.0.0.17(EA)
03:44:38:39:ff:ff:01:00:00:03  LR    27.0.0.15:17          10
27.0.0.16(EA),27.0.0.17(EA)
03:44:38:39:ff:ff:02:00:00:01  R     -                     10
27.0.0.18(A),27.0.0.19(A),27.0.0.20(A)
03:44:38:39:ff:ff:02:00:00:02  R     -                     10
27.0.0.18(A),27.0.0.19(A),27.0.0.20(A)
03:44:38:39:ff:ff:02:00:00:03  R     -                     10
27.0.0.18(A),27.0.0.19(A),27.0.0.20(A)
torm-11#

Before Fix:-
```
torm-11# show bgp l2 evpn es 03:44:38:39:ff:ff:01:00:00:01 json
{
  "esi":"03:44:38:39:ff:ff:01:00:00:01",
  "rd":"27.0.0.15:15",
  "type":[
    "local",
    "remote"
  ],
  "vteps":[
    {
      "vtep_ip":"27.0.0.16",
      "flags":[
        "esr",
        "active"
      ],
      "dfPreference":32767,
      "dfAlgorithm":32767 =====> dfAlgorithm is same as dfPreference
    },
    {
      "vtep_ip":"27.0.0.17",
      "flags":[
        "esr",
        "active"
      ],
      "dfPreference":32767,
      "dfAlgorithm":32767 =====> dfAlgorithm is same as dfPreference
    }
  ],
  "flags":[
    "up",
    "advertiseEVI"
  ],
  "originator_ip":"27.0.0.15",
  "remoteVniCount":10,
  "vrfCount":3,
  "macipPathCount":33,
  "macipGlobalPathCount":264,
  "inconsistentVniVtepCount":0,
  "localEsDfPreference":50000,
  "fragments":[
    {
      "rd":"27.0.0.15:15",
      "eviCount":10
    }
  ]
}
torm-11#
```

After Fix:-

```
torm-11# show bgp l2vpn evpn es 03:44:38:39:ff:ff:01:00:00:01 json
{
  "esi":"03:44:38:39:ff:ff:01:00:00:01",
  "rd":"27.0.0.15:4",
  "type":[
    "local",
    "remote"
  ],
  "vteps":[
    {
      "vtep_ip":"27.0.0.16",
      "flags":[
        "esr",
        "active"
      ],
      "dfPreference":32767,
      "dfAlgorithm":"preference" ---- dfAlgorithm shows properly
    },
    {
      "vtep_ip":"27.0.0.17",
      "flags":[
        "esr",
        "active"
      ],
      "dfPreference":32767,
      "dfAlgorithm":"preference" --- dfAlgorithm shows properly
    }
  ],
  "vniCount":10,
  "flags":[
    "up",
    "advertiseEVI"
  ],
  "originator_ip":"27.0.0.15",
  "remoteVniCount":10,
  "vrfCount":3,
  "macipPathCount":33,
  "macipGlobalPathCount":264,
  "inconsistentVniVtepCount":0,
  "localEsDfPreference":50000,
  "fragments":[
    {
      "rd":"27.0.0.15:4",
      "eviCount":10
    }
  ]
}
torm-11#
```

Ticket:#3411912

Issue:3411912

Testing: UT done

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
2023-04-16 10:29:09 -07:00
Donatas Abraitis e88e1c0e89
Merge pull request #13314 from anlancs/bgp/remove-check-group
bgpd: Remove unnecessary check for groups
2023-04-16 11:52:42 +03:00
Donatas Abraitis 73f6fec1cf
Merge pull request #13312 from chiragshah6/fdev2
zebra: EVPN MH ES-peer Sync MAC installed as inactive
2023-04-16 11:27:53 +03:00
Donatas Abraitis 73c17b4b20
Merge pull request #13302 from anlancs/fix/reload-remote-as
tools: fix missing remote-as configuration when reload
2023-04-16 09:50:40 +03:00
anlan_cs 06af0667ad bgpd: Remove unnecessary check for groups
The `NULL` check for newly created groups (`updgroup` and `subgroup`)
are unnecessary,  just remove them.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-04-16 13:52:35 +08:00
Christian Hopps 60e037780e tests: switch to munet
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-15 13:29:38 -04:00
Jafar Al-Gharaibeh 86d23d7166
Merge pull request #13313 from LabNConsulting/cleanup-bad-warning
tests: restart bgpd to avoid warnings in follow on tests
2023-04-15 12:18:08 -05:00
Christian Hopps c568b4ac4f tests: restart bgpd to avoid warnings in follow on tests
The tests are killing bgpd and then ending, the next test is checking for all
daemons running and spewing warnings to stderr. Restart the daemons before
ending the test (like other tests in this same module) to avoid this.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-15 09:39:05 -04:00
Christian Hopps 352ddc72b7 tests: import munet 0.12.12
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-15 08:48:19 -04:00
Donald Sharp 5537b907e9
Merge pull request #13311 from LabNConsulting/fix-python-warning
tests: fix warning, incorrect use of `is` use ==
2023-04-14 20:21:25 -04:00
anlan_cs 9ea17a5d49 tools: Make check flag really work for reload
The check flag of `found_pg_cmd` is already there, but not used.
So, make it really work for reload.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-04-15 06:46:25 +08:00
anlan_cs a70895e83a tools: fix missing remote-as configuration when reload
From commit `411d1a2`, `bgp_delete_nbr_remote_as_line()` is added to
remove some specific bgp neighbors.  But, when reloading the following
configuration, it will wrongly remove some good ones:
`neighbor 66.66.66.6 remote-as internal`:

```
router bgp 66
 bgp router-id 172.16.204.6
 neighbor ANLAN peer-group
 neighbor ANLAN remote-as internal
 neighbor 66.66.66.6 remote-as internal <- LOST
 neighbor 66.66.66.60 peer-group ANLAN
```

The reason is that "66.66.66.6" is included in "66.66.66.60" literally,
then it is mistakenly thought to be a match.  Just fix it with
excat match.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-04-15 06:42:36 +08:00
Chirag Shah 4a1f91a366 zebra: evpn mh sync mac install as inactive
EVPN MH ES reduendant VTEPs need to install
sync MAC as notify inactive and generate
ND:Proxy stamped extended community on Type-2
route.

Ticket:#3436621
Issue:3436621

Testing Done:

tor-11 originates type-2 MAC route:

tor-11# bridge -d fdb show | grep 00:65:00:00:00:01
00:65:00:00:00:01 dev hostbond1 vlan 1000 notify master bridge static

tor-12 receives sync MAC route:

Before fix:
----------
tor-12:/# bridge -d fdb show | grep 00:65:00:00:00:01
00:65:00:00:00:01 dev hostbond1 vlan 1000 notify master bridge static

After fix: inactive is set to MAC entry
----------
tor-12:/#bridge -d fdb show | grep 00:65:00:00:00:01
00:65:00:00:00:01 dev hostbond1 vlan 1000 notify inactive master bridge
static

Notice the difference in `inactive` post notify on tor-12
with the fix.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
2023-04-14 14:50:24 -07:00
Christian Hopps 7c5d70611a tests: fix warning, incorrect use of is.
Remove the never-executed code.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-14 17:23:58 -04:00
Donald Sharp be574cf987
Merge pull request #13303 from pguibert6WIND/srv6_seg6local_defaultvrf
lib: fix handle seg6local routes on default vrf
2023-04-14 10:36:12 -04:00
Donatas Abraitis 8a83ced5c1
Merge pull request #13308 from donaldsharp/if_pr_needs
git: Workflow grammar fixup
2023-04-14 17:03:09 +03:00
Donald Sharp 9a28372044 git: Workflow grammar fixup
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-14 09:55:28 -04:00
Jafar Al-Gharaibeh d340aaebf0
Merge pull request #13297 from donaldsharp/ospf6_missing_nh
ospf6d: missing ECMP NHs in certain topologies
2023-04-14 08:09:04 -05:00
Donald Sharp a5304577ca
Merge pull request #13300 from louis-6wind/iso_doc
doc: fix the print iso macro documentation
2023-04-14 09:05:47 -04:00
Donald Sharp 12fa4d4b6d
Merge pull request #13301 from opensourcerouting/fix/crash_bgp_received_routes
bgpd: Fix crash for `show bgp ... neighbor received-routes detail|PREFIX
2023-04-14 09:04:07 -04:00
Philippe Guibert c37812dd2a lib: fix handle seg6local routes on default vrf
An L3VPN network can be configured on the main BGP instance,
with an SRv6 SID. By declaring a network, a seg6local route
is created but remains invalid.

The below BGP VPN configuration the default VRF has been
used:
> router bgp 1
>  address-family ipv6 unicast
>   sid vpn export auto
>   rd vpn export 1:30
>   rt vpn both 77:77
>   import vpn
>   export vpn
>   network 2001:7::/64
>  exit-address-family

The below seg6local route has been added:

> # show ipv6 route
> [..]
> B   2001:db8:2:2:300::/128 [20/0] is directly connected, unknown inactive, seg6local End.DT6 table 254, seg6 ::, weight 1, 00:00:07
>

When creating the seg6local route, an interface is used as nexthop.
The interface index is obtained from the vrf identifier. This is
true when using VRF interfaces, but is wrong when using the lo
interface which usually has the '1' ifindex whereas the vrf id for
the default VRF is 0.

Get the appropriate index from the vrf identifier.
The below seg6local route is visible:

> # show ipv6 route
> [..]
> B>* 2001:db8:1:1:300::/128 [20/0] is directly connected, lo, seg6local End.DT6 table 254, seg6 ::, weight 1, 00:00:15
>

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-04-14 12:17:10 +02:00
Donatas Abraitis ea5a8e4d58 bgpd: Fix crash for show bgp ... neighbor received-routes detail|PREFIX
BGP: Received signal 11 at 1681287514 (si_addr 0x8, PC 0x559ab42eb1d9); aborting...
BGP: /lib/libfrr.so.0(zlog_backtrace_sigsafe+0x71) [0x7f4356b19af1]
BGP: /lib/libfrr.so.0(zlog_signal+0xf9) [0x7f4356b19cf9]
BGP: /lib/libfrr.so.0(+0xf5af5) [0x7f4356b4baf5]
BGP: /lib/x86_64-linux-gnu/libpthread.so.0(+0x14420) [0x7f43568ab420]
BGP: /usr/lib/frr/bgpd(prefix_rd2str+0x29) [0x559ab42eb1d9]
BGP: /usr/lib/frr/bgpd(route_vty_out_detail_header+0x7ca) [0x559ab43061ba]
BGP: /usr/lib/frr/bgpd(+0x1771a6) [0x559ab430a1a6]
BGP: /usr/lib/frr/bgpd(+0x177f06) [0x559ab430af06]
BGP: /usr/lib/frr/bgpd(+0x178c8b) [0x559ab430bc8b]
BGP: /usr/lib/frr/bgpd(+0x179e7e) [0x559ab430ce7e]
BGP: /lib/libfrr.so.0(+0x9417e) [0x7f4356aea17e]
BGP: /lib/libfrr.so.0(cmd_execute_command+0x111) [0x7f4356aea321]
BGP: /lib/libfrr.so.0(cmd_execute+0xd0) [0x7f4356aea4c0]
BGP: /lib/libfrr.so.0(+0x10d5de) [0x7f4356b635de]
BGP: /lib/libfrr.so.0(+0x10d81d) [0x7f4356b6381d]
BGP: /lib/libfrr.so.0(+0x110b03) [0x7f4356b66b03]
BGP: /lib/libfrr.so.0(event_call+0x81) [0x7f4356b5df91]
BGP: /lib/libfrr.so.0(frr_run+0xe8) [0x7f4356b11b58]
BGP: /usr/lib/frr/bgpd(main+0x385) [0x559ab4281d55]
BGP: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f43566c9083]
BGP: /usr/lib/frr/bgpd(_start+0x2e) [0x559ab428437e]
BGP: in thread vtysh_read scheduled from lib/vty.c:2833 vty_event()

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-04-13 23:37:06 +03:00
Donald Sharp 89f0982149
Merge pull request #13298 from opensourcerouting/dead-import-check
pimd, doc: remove dead import check references
2023-04-13 13:33:47 -04:00
Louis Scalbert 4ef4cbea6b doc: fix the print iso macro documentation
fix the print iso macro documentation

Fixes: 7f9ab3b0bb ("lib: Add ISO System & Network format to printfrr")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-04-13 18:27:34 +02:00
Jafar Al-Gharaibeh 9539c4e4f0
Merge pull request #13293 from donaldsharp/run_black_on_test
tests: Run formatting script on test_isis_advertise_high_metrics.py
2023-04-13 10:47:26 -05:00
David Lamparter 5903e49c7b pimd, doc: remove dead import check references
ZEBRA_IMPORT_CHECK_UPDATE has been gone for more than a year; remove
some leftover dead references to it.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-04-13 16:52:57 +02:00
lynne 637e6f293b ospf6d: missing ECMP NHs in certain topologies
When ospf6 is started up and SPF is run depending on which route is
selected as the parent route we could miss adding a NH.   If one
possible parent route has two equal cost paths and the second possible
parent route has only one depending on which one is selected first
determines if we have have one or two NHs.

In the network below when creating a route 2001:db8:3:4::/64 in R2.
When SPF is run there are two possible parent routes R3 and R4.

     2001:db8:1:2  +-----+   2001:db8:2:5
    +--------------+  2  +---------------+
    |          ::2 |     | ::2           |
    |              +-----+               |
    |                                    |
 ::1|                                    |
+-----+                                  |::5
|  1  |2001:db8:1:3+-----+2001:db8:3:5+-----+2001:db8:5:6+-----+
|     +------------+  3  +------------+  5  +------------+  6  |
+-----+ ::1    ::3 |     |::3     ::5 |     |::5      ::6|     |
 ::1|              +-----+            +-----+            +-----+
    |                 |::3
    |                 | 2001:db8:3:4
    |                 |
    |                 |::4
    | 2001:db8:1:4 +-----+
    +--------------+  4  |
               ::4 |     |
                   +-----+

The problem was if we first created the route to 2001:db8:3:4::/64 with R3
as the parent route all is fine.  The code was merging the NH from the parent
route and R3 has 2 NH, one pointing to R1 and one to R5.   But if route
2001:db8:3:4::/64 was first created with parent as R4, it has only one NH
pointing to R1, and then later a new vertex was created pointing to R3 the
code would only copy the nhs from the vertex not from the parent route.   The
vertex always has just one NH.   But the parent route could have more.  So
when we would bringup this setup one time we would see one NH for
2001:db8:3:4::/64 and the next time we would see two NHs.  The code has been
modified so that it behaves the same when the route is first created, or when
a vertex is created, it selects the NHs from the parent route.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2023-04-13 07:55:03 -04:00
Donald Sharp 635d65e2c8
Merge pull request #13097 from AbhishekNR/mroute
pim6d: mroutes not created after disabling and enabling PIMv6.
2023-04-13 07:41:49 -04:00
Donald Sharp b1fe933c60
Merge pull request #13244 from patrasar/pim_bsm
pimd: Process no-forward BSM packet
2023-04-13 07:36:52 -04:00
Donald Sharp 8132d1e905
Merge pull request #13287 from anlancs/bgpd-cleanup-9
bgpd: Simplify the checking local path
2023-04-13 07:33:13 -04:00
Donald Sharp e503294060 tests: Run formatting script on test_isis_advertise_high_metrics.py
Apparently this is needed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-13 07:29:00 -04:00
Donald Sharp 8356f48119
Merge pull request #13284 from isabelladeleon12/fix_adv_high_metrics_ut_warning
tests: Fix topotest invalid escape sequence in isis_advertise_high_me…
2023-04-13 07:26:37 -04:00
Christian Hopps 2437ddf0b7
Merge pull request #13279 from idryzhov/if-rmap-northbound
lib: convert if_rmap config output to northbound
2023-04-13 03:50:11 -04:00