]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
2 years agolib: autodetect systemd/journald log on stdout
David Lamparter [Sun, 16 Jan 2022 15:15:41 +0000 (16:15 +0100)]
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>
2 years agolib: RFC5424 & journald extended syslog target
David Lamparter [Wed, 29 Apr 2020 08:26:05 +0000 (10:26 +0200)]
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>
2 years agolib: add frr_early_init hook
David Lamparter [Sun, 16 Jan 2022 14:25:31 +0000 (15:25 +0100)]
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>
2 years agobuild: check for sendmmsg() and struct mmsghdr
David Lamparter [Sat, 10 Apr 2021 21:03:58 +0000 (23:03 +0200)]
build: check for sendmmsg() and struct mmsghdr

These will be used by the RFC5424 log target.

Signed-off-by: David Lamparter <equinox@diac24.net>
2 years agoMerge pull request #10342 from Marlinc/rfc9136
Donald Sharp [Sat, 15 Jan 2022 12:27:21 +0000 (07:27 -0500)]
Merge pull request #10342 from Marlinc/rfc9136

docs(bgp): refer to rfc9136 instead of draft

2 years agoMerge pull request #10339 from opensourcerouting/printfrr-20220114
Donald Sharp [Fri, 14 Jan 2022 19:15:03 +0000 (14:15 -0500)]
Merge pull request #10339 from opensourcerouting/printfrr-20220114

lib: printfrr shenanigans

2 years agodocs(bgp): refer to rfc9136 instead of draft
Marlin Cremers [Fri, 14 Jan 2022 17:50:22 +0000 (18:50 +0100)]
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>
2 years agoMerge pull request #10335 from ton31337/fix/reduce_nesting_show_neighbor_bgp
Donald Sharp [Fri, 14 Jan 2022 13:11:48 +0000 (08:11 -0500)]
Merge pull request #10335 from ton31337/fix/reduce_nesting_show_neighbor_bgp

bgpd: Reduce nesting for bgp_show_peer()

2 years ago*: use semicolon after printfrr_ext_autoreg_{p,d}
David Lamparter [Fri, 14 Jan 2022 10:56:25 +0000 (11:56 +0100)]
*: 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>
2 years agolib: add `%pTH` / `%pTHD` for printing thread info
David Lamparter [Wed, 12 Jan 2022 01:07:41 +0000 (02:07 +0100)]
lib: add `%pTH` / `%pTHD` for printing thread info

Refer to docs in doc/developer for details.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agolib: add time formatting printfrr exts
David Lamparter [Thu, 13 Jan 2022 06:51:54 +0000 (07:51 +0100)]
lib: add time formatting printfrr exts

Refer to docs in doc/developer for details.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agolib: add `s` option to `pI4`/`pI6`/`pIA` printfrr
David Lamparter [Wed, 5 Jan 2022 15:23:23 +0000 (16:23 +0100)]
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>
2 years agotools: disable printf ext checks in checkpatch
David Lamparter [Wed, 5 Jan 2022 18:51:19 +0000 (19:51 +0100)]
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>
2 years agoMerge pull request #10337 from opensourcerouting/clippy-conds
Donald Sharp [Thu, 13 Jan 2022 18:16:13 +0000 (13:16 -0500)]
Merge pull request #10337 from opensourcerouting/clippy-conds

python: pass conditionals through clippy for DEFPY

2 years agoMerge pull request #10327 from ton31337/fix/reduce_nested_loops
Igor Ryzhov [Thu, 13 Jan 2022 17:09:50 +0000 (20:09 +0300)]
Merge pull request #10327 from ton31337/fix/reduce_nested_loops

*: Add FOREACH_AFI_SAFI_NSF(afi, safi) macro to reduce nesting

2 years agobgpd: Reduce nesting for bgp_show_peer()
Donatas Abraitis [Thu, 13 Jan 2022 08:15:03 +0000 (10:15 +0200)]
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>
2 years agoMerge pull request #10279 from SaiGomathiN/pim_intf
David Lamparter [Thu, 13 Jan 2022 15:13:54 +0000 (16:13 +0100)]
Merge pull request #10279 from SaiGomathiN/pim_intf

2 years agopython: pass conditionals through clippy for DEFPY
David Lamparter [Thu, 13 Jan 2022 13:18:29 +0000 (14:18 +0100)]
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>
2 years agoMerge pull request #10336 from ton31337/feature/show_gr_llgr_timers_per_neighbor
Donald Sharp [Thu, 13 Jan 2022 14:30:16 +0000 (09:30 -0500)]
Merge pull request #10336 from ton31337/feature/show_gr_llgr_timers_per_neighbor

bgpd: Show Long-lived Graceful Restart seconds remaining per prefix

2 years agoMerge pull request #10314 from ckishimo/ospf6d_extstub
Donald Sharp [Thu, 13 Jan 2022 14:04:35 +0000 (09:04 -0500)]
Merge pull request #10314 from ckishimo/ospf6d_extstub

ospf6d: do not send Type-5 into stub area

2 years agoMerge pull request #10324 from anlancs/fix-ospf-stream
Donald Sharp [Thu, 13 Jan 2022 14:03:58 +0000 (09:03 -0500)]
Merge pull request #10324 from anlancs/fix-ospf-stream

lib: fix the right value is returned for fail cases

2 years agoMerge pull request #10334 from mobash-rasool/igmp-conf-fix
Donald Sharp [Thu, 13 Jan 2022 14:00:51 +0000 (09:00 -0500)]
Merge pull request #10334 from mobash-rasool/igmp-conf-fix

pimd: IGMP messages may be longer than 8 octets

2 years ago*: Add FOREACH_AFI_SAFI_NSF(afi, safi) macro to reduce nesting
Donatas Abraitis [Wed, 12 Jan 2022 20:43:52 +0000 (22:43 +0200)]
*: 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>
2 years agobgpd: Show Long-lived Graceful Restart timer remaining per prefix
Donatas Abraitis [Thu, 13 Jan 2022 08:39:15 +0000 (10:39 +0200)]
bgpd: Show Long-lived Graceful Restart timer remaining per prefix

```
exit1-debian-11# sh ip bgp 100.100.100.100/32
BGP routing table entry for 100.100.100.100/32, version 7
Paths: (2 available, best #2, table default)
  Advertised to non peer-group peers:
  home-spine1.donatas.net(192.168.0.2)
  65002, (stale)
    192.168.10.17 from donatas-pc(192.168.10.17) (0.0.0.0)
      Origin incomplete, valid, external
      Community: llgr-stale
      Last update: Thu Jan 13 08:58:08 2022
      Time until Long-lived stale route deleted: 18
  65001
    192.168.0.2 from home-spine1.donatas.net(192.168.0.2) (2.2.2.2)
      Origin incomplete, metric 0, valid, external, best (First path received)
      Last update: Thu Jan 13 08:57:56 2022
```

```
~# vtysh -c 'show ip bgp 100.100.100.100/32 json' | jq '."paths"[] | ."llgrSecondsRemaining"'
17
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Avoid additional check for json output under show ip bgp route
Donatas Abraitis [Thu, 13 Jan 2022 08:34:04 +0000 (10:34 +0200)]
bgpd: Avoid additional check for json output under show ip bgp route

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agopimd: IGMPv2 leave msg may be longer than 8 octets
Mobashshera Rasool [Thu, 13 Jan 2022 08:07:12 +0000 (00:07 -0800)]
pimd: IGMPv2 leave msg may be longer than 8 octets

Fix the code as per RFC 2236 section 2.5:
   Note that IGMP messages may be longer than 8 octets, especially
   future backwards-compatible versions of IGMP.  As long as the Type is
   one that is recognized, an IGMPv2 implementation MUST ignore anything
   past the first 8 octets while processing the packet.  However, the
   IGMP checksum is always computed over the whole IP payload, not just
   over the first 8 octets.

Fixes: #10331
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopimd: IGMPv2 report msg may be longer than 8 octets
Mobashshera Rasool [Thu, 13 Jan 2022 04:39:48 +0000 (20:39 -0800)]
pimd: IGMPv2 report msg may be longer than 8 octets

As per test case IGMP Conformance test case 5.6, report
messages longer than 8 octets should be accepted to support
future-backward compatibilty.

Fix the code as per RFC 2236 section 2.5:
    Note that IGMP messages may be longer than 8 octets, especially
    future backwards-compatible versions of IGMP.  As long as the Type is
    one that is recognized, an IGMPv2 implementation MUST ignore anything
    past the first 8 octets while processing the packet.  However, the
    IGMP checksum is always computed over the whole IP payload, not just
    over the first 8 octets.

Fixes: #10331
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agoMerge pull request #10328 from ton31337/fix/vty_json
Igor Ryzhov [Thu, 13 Jan 2022 06:45:57 +0000 (09:45 +0300)]
Merge pull request #10328 from ton31337/fix/vty_json

2 years agoMerge pull request #10266 from opensourcerouting/bgp-aggr-rm
Donatas Abraitis [Wed, 12 Jan 2022 21:18:58 +0000 (23:18 +0200)]
Merge pull request #10266 from opensourcerouting/bgp-aggr-rm

bgpd: fix aggregate route unsuppression bug

2 years agoospfd: Use vty_json() for show_ip_ospf_gr_helper_cmd
Donatas Abraitis [Wed, 12 Jan 2022 20:51:46 +0000 (22:51 +0200)]
ospfd: Use vty_json() for show_ip_ospf_gr_helper_cmd

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Use vty_json() for bgp_print_dampening_parameters()
Donatas Abraitis [Wed, 12 Jan 2022 20:50:26 +0000 (22:50 +0200)]
bgpd: Use vty_json() for bgp_print_dampening_parameters()

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #10282 from opensourcerouting/pim6-addr-replace
Donald Sharp [Wed, 12 Jan 2022 20:34:46 +0000 (15:34 -0500)]
Merge pull request #10282 from opensourcerouting/pim6-addr-replace

pimd: `prefix_sg` => `pim_sgaddr`

2 years agoMerge pull request #10325 from donaldsharp/peer_conditional_adv_cleanup
Donatas Abraitis [Wed, 12 Jan 2022 20:15:49 +0000 (22:15 +0200)]
Merge pull request #10325 from donaldsharp/peer_conditional_adv_cleanup

bgpd: Remove unneeded loop over all peers

2 years agopimd: `prefix_sg` => `pim_sgaddr`
David Lamparter [Tue, 4 Jan 2022 16:54:44 +0000 (17:54 +0100)]
pimd: `prefix_sg` => `pim_sgaddr`

Mostly just 2 sed calls:

- `sed -e 's%struct prefix_sg%pim_sgaddr%g'`
- `sed -e 's%memset(&sg, 0, sizeof(pim_sgaddr));%memset(\&sg, 0, sizeof(sg));%g'`

Plus a bunch of fixing whatever that broke.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agopimd: temporarily disable IPv6 types
David Lamparter [Mon, 10 Jan 2022 08:40:50 +0000 (09:40 +0100)]
pimd: temporarily disable IPv6 types

Just putting the infrastructure in place and having it disabled is
actually good progress here;  have the compiler make itself useful and
tell us what we have to do to get the basics right.

(The next commit will cause a *lot* of compile errors as soon as
`PIM_V6_TEMP_BREAK` is set; but there is no reason to force everything
into a single step here.)

To enable `pim_addr = in6_addr`, run `make PIM_V6_TEMP_BREAK=1` (remove
previous compile results with `rm pimd/pim6d-*.o`)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agopimd: abstract addresses for IPv4/IPv6 PIM
David Lamparter [Tue, 4 Jan 2022 16:18:06 +0000 (17:18 +0100)]
pimd: abstract addresses for IPv4/IPv6 PIM

Depending on whether we're compiling pimd or pim6d, these types take on
the appropriate AF being used.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agopimd: move `%pSG4` to `%pPSG4`
David Lamparter [Tue, 4 Jan 2022 15:50:53 +0000 (16:50 +0100)]
pimd: move `%pSG4` to `%pPSG4`

Since this is only used in very few places, moving it out of the way is
reasonable.  (`%pSG` will be pim_sgaddr)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agopim6d: add skeleton for IPv6 PIM daemon
David Lamparter [Thu, 11 Nov 2021 16:34:00 +0000 (17:34 +0100)]
pim6d: add skeleton for IPv6 PIM daemon

This newborn pim6d is essentially an empty husk, but it does build
without warnings or errors and has the build system integration prepared
and working.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agobgpd: Remove unneeded loop over all peers
Donald Sharp [Wed, 12 Jan 2022 14:49:59 +0000 (09:49 -0500)]
bgpd: Remove unneeded loop over all peers

The bgp_notify_conditional_adv_scanner function was/is looping
over all peers.  And only matching on the passed in peer,
based upon the subgroup.  As such we do not need to loop
over everything and just cut-to-the chase and just modify
the peer structure.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agolib: fix the right value is returned for fail cases
anlan_cs [Wed, 12 Jan 2022 12:53:25 +0000 (07:53 -0500)]
lib: fix the right value is returned for fail cases

Currently `bfd_get_peer_info` should return invalid sp->family
and dp->family during fail cases.

Before this fix, in those fail cases `bfd_get_peer_info` maybe
return valid sp->family and dp->family.

This fix ensures all fail cases return invalid sp->family and
dp->family for outside callers.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2 years agoMerge pull request #10317 from ton31337/fix/shutdown_msg
Igor Ryzhov [Wed, 12 Jan 2022 11:36:58 +0000 (14:36 +0300)]
Merge pull request #10317 from ton31337/fix/shutdown_msg

bgpd: Make sure we are playing with non-NULL for bgp shutdown message

2 years agoMerge pull request #10315 from ckishimo/ospf6d_cleaning
Igor Ryzhov [Wed, 12 Jan 2022 11:35:44 +0000 (14:35 +0300)]
Merge pull request #10315 from ckishimo/ospf6d_cleaning

ospf6d: some cleaning

2 years agoMerge pull request #9285 from anlancs/fix-ospf6d-cli-with-nonexist-vrf
Igor Ryzhov [Wed, 12 Jan 2022 11:26:28 +0000 (14:26 +0300)]
Merge pull request #9285 from anlancs/fix-ospf6d-cli-with-nonexist-vrf

ospf6d: add prompt for commands with non-exist vrf

2 years agoMerge pull request #9292 from mobash-rasool/ospfv3-bug2
Igor Ryzhov [Wed, 12 Jan 2022 11:25:17 +0000 (14:25 +0300)]
Merge pull request #9292 from mobash-rasool/ospfv3-bug2

ospfv3 is showing enabled on loopback interface although it is not

2 years agoMerge pull request #10320 from anlancs/ospf-one-word
Donatas Abraitis [Wed, 12 Jan 2022 08:42:02 +0000 (10:42 +0200)]
Merge pull request #10320 from anlancs/ospf-one-word

ospfd: correct one word of the output message

2 years agoMerge pull request #10312 from anlancs/bfd-rename-ttl
Rafael Zalamena [Tue, 11 Jan 2022 17:30:05 +0000 (14:30 -0300)]
Merge pull request #10312 from anlancs/bfd-rename-ttl

lib: rename one bfd parameter name to reflect real meaning

2 years agobgpd: fix aggregate route unsuppression bug
Rafael Zalamena [Mon, 27 Dec 2021 18:10:30 +0000 (15:10 -0300)]
bgpd: fix aggregate route unsuppression bug

Unsuppress route part of the aggregation when route-map configuration
is removed before the aggregation itself.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2 years agoMerge pull request #10235 from proelbtn/srv6-soft-reconf
Russ White [Tue, 11 Jan 2022 16:03:34 +0000 (11:03 -0500)]
Merge pull request #10235 from proelbtn/srv6-soft-reconf

SRv6 routes aren't inserted into data plane correctly with soft-reconfiguration

2 years agobgpd: Make sure we are playing with non-NULL for bgp shutdown message
Donatas Abraitis [Tue, 11 Jan 2022 10:24:41 +0000 (12:24 +0200)]
bgpd: Make sure we are playing with non-NULL for bgp shutdown message

```
*** CID 1510738:  Null pointer dereferences  (FORWARD_NULL)
/bgpd/bgp_vty.c: 4243 in bgp_shutdown_msg_magic()
4237            if (msgstr && strlen(msgstr) > BGP_ADMIN_SHUTDOWN_MSG_LEN) {
4238                    vty_out(vty, "%% Shutdown message size exceeded %d\n",
4239                            BGP_ADMIN_SHUTDOWN_MSG_LEN);
4240                    return CMD_WARNING_CONFIG_FAILED;
4241            }
4242
>>>     CID 1510738:  Null pointer dereferences  (FORWARD_NULL)
>>>     Passing null pointer "msgstr" to "bgp_shutdown_enable", which dereferences it.
4243            bgp_shutdown_enable(bgp, msgstr);
4244            XFREE(MTYPE_TMP, msgstr);
4245
4246            return CMD_SUCCESS;
4247     }
4248
```

```
*** CID 1510737:  Null pointer dereferences  (REVERSE_INULL)
/bgpd/bgpd.c: 4344 in bgp_shutdown_enable()
4338                    /* continue, if peer is already in administrative shutdown. */
4339                    if (CHECK_FLAG(peer->flags, PEER_FLAG_SHUTDOWN))
4340                            continue;
4341
4342                    /* send a RFC 4486 notification message if necessary */
4343                    if (BGP_IS_VALID_STATE_FOR_NOTIF(peer->status)) {
>>>     CID 1510737:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "msg" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
4344                            if (msg)
4345                                    bgp_notify_send_with_data(
4346                                            peer, BGP_NOTIFY_CEASE,
4347                                            BGP_NOTIFY_CEASE_ADMIN_SHUTDOWN, data,
4348                                            datalen + 1);
4349                            else
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoospfd: correct one word of the output message
anlan_cs [Tue, 11 Jan 2022 13:51:22 +0000 (08:51 -0500)]
ospfd: correct one word of the output message

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2 years agopimd: Modifying members of pim_interface to accommodate IPv6 changes
Sai Gomathi [Tue, 4 Jan 2022 14:00:50 +0000 (06:00 -0800)]
pimd: Modifying members of pim_interface to accommodate IPv6 changes

Modifying the members of pim_interface which are to be used
for both IPv4 and IPv6 to common names(for both MLD and IGMP).

Issues: #10023

Co-authored-by: Mobashshera Rasool <mrasool@vmware.com>
Co-authored-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2 years agoospf6d: add missing htons
ckishimo [Mon, 10 Jan 2022 17:02:16 +0000 (18:02 +0100)]
ospf6d: add missing htons

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2 years agoospf6d: fix typos
ckishimo [Mon, 10 Jan 2022 13:56:34 +0000 (14:56 +0100)]
ospf6d: fix typos

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2 years agoospf6d: use __func__
ckishimo [Mon, 10 Jan 2022 13:50:59 +0000 (14:50 +0100)]
ospf6d: use __func__

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2 years agoMerge pull request #10212 from mobash-rasool/mld-pim6-dev-prefix
David Lamparter [Tue, 11 Jan 2022 09:32:16 +0000 (10:32 +0100)]
Merge pull request #10212 from mobash-rasool/mld-pim6-dev-prefix

2 years agoospf6d: give error information for commands with non-exist vrfs
anlan_cs [Tue, 11 Jan 2022 09:21:05 +0000 (04:21 -0500)]
ospf6d: give error information for commands with non-exist vrfs

Currently the ospf6d's commands with non-exist vrfs can't give the error
informations to users.

This commit adds a macro "OSPF6_CMD_CHECK_VRF" to give error information
if with non-exist vrfs. As usual, skip the checking process in the case
of json.

So one command can call this macro to do the checking process in its
end. At that time it need know json style or not, so add "json" parameter for
several related functions.

BTW, suppress the build warning of the macro `OSPF6_FIND_VRF_ARGS`:
"Macros starting with if should be enclosed by a do - while loop to avoid
possible if/else logic defects."

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2 years agoMerge pull request #10313 from anlancs/fix-ospf-check
Igor Ryzhov [Tue, 11 Jan 2022 08:32:12 +0000 (11:32 +0300)]
Merge pull request #10313 from anlancs/fix-ospf-check

ospfd,ospf6d: fix wrong comparison of routemap name

2 years agopimd: Modifying in_addr to pim_addr in struct pim_neighbor and gm_sock
sarita patra [Tue, 14 Dec 2021 12:25:40 +0000 (04:25 -0800)]
pimd: Modifying in_addr to pim_addr in struct pim_neighbor and gm_sock

Changed struct in_addr source_addr to struct PIM_ADDR source_addr
which is to be used in both IPv4 and IPv6(Both MLD and IGMP).
Reviewed-by: Mobashshera Rasool <mrasool@vmware.com>
Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Modifying in_addr to pim_addr in struct pim_upstream for IPv6.
sarita patra [Tue, 14 Dec 2021 12:22:28 +0000 (04:22 -0800)]
pimd: Modifying in_addr to pim_addr in struct pim_upstream for IPv6.

Changed struct in_addr upstream_addr and struct in_addr upstream_register
to struct PIM_ADDR upstream_addr and struct PIM_ADDR upstream_register
which are to be used in both IPv4 and IPv6(Both MLD and IGMP).

Reviewed-by: Mobashshera Rasool <mrasool@vmware.com>
Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Modifying in_addr to pim_addr in struct pim_nexthop for IPv6.
sarita patra [Tue, 14 Dec 2021 12:17:29 +0000 (04:17 -0800)]
pimd: Modifying in_addr to pim_addr in struct pim_nexthop for IPv6.

Changed struct in_addr last_lookup to struct PIM_ADDR last_lookup
which is to be used in both IPv4 and IPv6(Both MLD and IGMP).

Reviewed-by: Mobashshera Rasool <mrasool@vmware.com>
Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Modifying in_addr to pim_addr in struct igmp_group for IPv6.
sarita patra [Mon, 13 Dec 2021 14:03:31 +0000 (06:03 -0800)]
pimd: Modifying in_addr to pim_addr in struct igmp_group for IPv6.

Changed struct in_addr group_addr to struct PIM_ADDR group_addr
in struct igmp_group which is to be used in
both IPv4 and IPv6(Both MLD and IGMP).

Reviewed-by: Mobashshera Rasool <mrasool@vmware.com>
Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Modifying in_addr to pim_addr in struct pim_iface_upstream_switch
sarita patra [Mon, 13 Dec 2021 14:01:36 +0000 (06:01 -0800)]
pimd: Modifying in_addr to pim_addr in struct pim_iface_upstream_switch

Changed struct in_addr address to struct pim_addr in struct
pim_iface_upstream_switch which is to be used in both IPv4
and IPv6(Both MLD and IGMP).

Reviewed-by: Mobashshera Rasool <mrasool@vmware.com>
Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Modifying in_addr to pim_addr in struct pim_jp_agg_group for IPv6
Mobashshera Rasool [Tue, 14 Dec 2021 07:42:29 +0000 (23:42 -0800)]
pimd: Modifying in_addr to pim_addr in struct pim_jp_agg_group for IPv6

Changed struct in_addr group to struct pim_addr group
which is to be used in both IPv4 and IPv6(Both MLD and IGMP).
Reviewed-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopimd: Modifying in_addr to pim_addr in igmp_source for IPv6.
Mobashshera Rasool [Tue, 14 Dec 2021 10:02:48 +0000 (02:02 -0800)]
pimd: Modifying in_addr to pim_addr in igmp_source for IPv6.

Changed struct in_addr source_addr to pim_addr source_addr
in struct igmp_source which is to be used in
both IPv4 and IPv6(Both MLD and IGMP).

Reviewed-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopimd: Modifying in_addr to pim_addr in igmp_join for IPv6.
Mobashshera Rasool [Tue, 14 Dec 2021 07:12:29 +0000 (23:12 -0800)]
pimd: Modifying in_addr to pim_addr in igmp_join for IPv6.

Changed struct in_addr source_addr to pim_addr source_addr
in struct igmp_join which is to be used in
both IPv4 and IPv6(Both MLD and IGMP).
Reviewed-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopimd: Modifying in_addr to pim_addr in struct pim_interface for IPv6
Mobashshera Rasool [Tue, 14 Dec 2021 06:31:39 +0000 (22:31 -0800)]
pimd: Modifying in_addr to pim_addr in struct pim_interface for IPv6

Based on compiler option, pim_addr will be changed to in_addr
or in6_addr for pimd and pim6d respectively.
Reviewed-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopimd: Modify in_addr to pim_addr in pim_assert_metric
Mobashshera Rasool [Tue, 14 Dec 2021 06:28:46 +0000 (22:28 -0800)]
pimd: Modify in_addr to pim_addr in pim_assert_metric

This change is to accomodate IPv6 and IPv4 in the same code.
Based on pimd or pim6d, this will be compiled.
Reviewed-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopimd: Modifying in_addr to pim_addr in struct pim_ifchannel for IPv6.
Mobashshera Rasool [Tue, 14 Dec 2021 06:20:37 +0000 (22:20 -0800)]
pimd: Modifying in_addr to pim_addr in struct pim_ifchannel for IPv6.

Changed struct in_addr ifassert_winner to pim_addr
which will be used in both IPv4 and IPv6(Both MLD and IGMP).
Reviewed-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agoospfd,ospf6d: make clear the comparison of routemap name
anlan_cs [Tue, 11 Jan 2022 01:45:10 +0000 (20:45 -0500)]
ospfd,ospf6d: make clear the comparison of routemap name

Comparison of the two pointer is confusing, they have no relevance
except the time both of them are empty.

Additionly modify one variable name and correct some comment words, they
are same in both ospfd and ospf6d.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2 years agoospf6d: remove duplicated code
ckishimo [Mon, 10 Jan 2022 13:34:24 +0000 (14:34 +0100)]
ospf6d: remove duplicated code

The OSPF6_LSA_UNAPPROVED flag is set in the function above
ospf6_lsa_translated_nssa_new, so there is no need to set
the flag again

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2 years agoospf6d: remove double htons
ckishimo [Mon, 10 Jan 2022 13:32:48 +0000 (14:32 +0100)]
ospf6d: remove double htons

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2 years agoospf6d: remove duplicated log
ckishimo [Mon, 10 Jan 2022 13:29:11 +0000 (14:29 +0100)]
ospf6d: remove duplicated log

When running topotest ospf6_topo2 we can see a log message with wrong lsa id

2021/12/20 23:14:40.330 OSPF6: [V8P0C-HB5Z2] ASBR[default:Status:3]: Update
2021/12/20 23:14:40.330 OSPF6: [Z489N-JAJ6P] ASBR[default:Status:3]: Already ASBR
2021/12/20 23:14:40.330 OSPF6: [Z9D0B-12SBJ] Redistribute 2001:db8:2::/64 (connected)
2021/12/20 23:14:40.330 OSPF6: [N66XP-ANN4G] Advertise as AS-External Id:8.70.41.177 prefix 2001:db8:2::/64 metric 2   (**)
2021/12/20 23:14:40.330 OSPF6: [K4Y9R-C22T6] Advertise new AS-External Id:0.0.0.3 prefix 2001:db8:2::/64 metric 2
2021/12/20 23:14:40.330 OSPF6: [PKX0N-KNRQR] Originate AS-External-LSA for 2001:db8:2::/64

This PR removes the log (instead of fixing it) as same information is printed
in the following entry

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2 years agoospf6d: do not send Type-5 into stub area
ckishimo [Mon, 10 Jan 2022 13:22:27 +0000 (14:22 +0100)]
ospf6d: do not send Type-5 into stub area

    When running the topotest ospf6_topo2, we see the ABR r2 sending type 5 LSA into
    the stub area 0.0.0.1 which are not acknowledged and the ABR keeps trying forever

    2022/01/07 15:51:57.953 LSUpdate to neighbor 10.254.254.1%r2-eth0
    2022/01/07 15:51:57.953 LSUpdate send on r2-eth0
    2022/01/07 15:51:57.953     src: fe80::5808:2aff:fe79:bb63
    2022/01/07 15:51:57.953     dst: fe80::785f:7aff:feee:82d6
    2022/01/07 15:51:57.953     OSPFv3 Type:4 Len:156 Router-ID:10.254.254.2
    2022/01/07 15:51:57.953     Area-ID:0.0.0.1 Cksum:0 Instance-ID:0
    2022/01/07 15:51:57.953     Number of LSA: 4
    2022/01/07 15:51:57.953     [AS-External Id:0.0.0.1 Adv:10.254.254.2]
    2022/01/07 15:51:57.953     Age:  198 SeqNum: 0x80000001 Cksum: 3959 Len: 28
    2022/01/07 15:51:57.953     [AS-External Id:0.0.0.2 Adv:10.254.254.2]
    2022/01/07 15:51:57.953     Age:  197 SeqNum: 0x80000001 Cksum: d5f2 Len: 36
    2022/01/07 15:51:57.953     [AS-External Id:0.0.0.3 Adv:10.254.254.2]
    2022/01/07 15:51:57.953     Age:  197 SeqNum: 0x80000001 Cksum: ebd9 Len: 36
    2022/01/07 15:51:57.953     [AS-External Id:0.0.0.4 Adv:10.254.254.2]
    2022/01/07 15:51:57.953     Age:  196 SeqNum: 0x80000001 Cksum: d1f3 Len: 36

    2022/01/07 15:52:02.953 LSUpdate to neighbor 10.254.254.1%r2-eth0
    2022/01/07 15:52:02.953 LSUpdate send on r2-eth0
    2022/01/07 15:52:02.953     src: fe80::5808:2aff:fe79:bb63
    2022/01/07 15:52:02.953     dst: fe80::785f:7aff:feee:82d6
    2022/01/07 15:52:02.953     OSPFv3 Type:4 Len:156 Router-ID:10.254.254.2
    2022/01/07 15:52:02.953     Area-ID:0.0.0.1 Cksum:0 Instance-ID:0
    2022/01/07 15:52:02.953     Number of LSA: 4
    2022/01/07 15:52:02.953     [AS-External Id:0.0.0.1 Adv:10.254.254.2]
    2022/01/07 15:52:02.953     Age:  203 SeqNum: 0x80000001 Cksum: 3959 Len: 28
    2022/01/07 15:52:02.954     [AS-External Id:0.0.0.2 Adv:10.254.254.2]
    2022/01/07 15:52:02.954     Age:  202 SeqNum: 0x80000001 Cksum: d5f2 Len: 36
    2022/01/07 15:52:02.954     [AS-External Id:0.0.0.3 Adv:10.254.254.2]
    2022/01/07 15:52:02.954     Age:  202 SeqNum: 0x80000001 Cksum: ebd9 Len: 36
    2022/01/07 15:52:02.954     [AS-External Id:0.0.0.4 Adv:10.254.254.2]
    2022/01/07 15:52:02.954     Age:  201 SeqNum: 0x80000001 Cksum: d1f3 Len: 36

    This PR prevents the ABR of sending type 5 lsa into a stub area

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2 years agolib: rename one bfd parameter name to reflect real meaning
anlan_cs [Mon, 10 Jan 2022 12:40:48 +0000 (07:40 -0500)]
lib: rename one bfd parameter name to reflect real meaning

As to "struct bfd_session_arg", just rename parameter "ttl" to "hops", in order
to  reflect real meaning.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2 years agoMerge pull request #10299 from donaldsharp/various_stuff
Donatas Abraitis [Mon, 10 Jan 2022 13:10:51 +0000 (15:10 +0200)]
Merge pull request #10299 from donaldsharp/various_stuff

Various stuff

2 years agoospf6d: remove ospf6Enabled from json output after deprecation cycle
Mobashshera Rasool [Wed, 4 Aug 2021 12:00:10 +0000 (05:00 -0700)]
ospf6d: remove ospf6Enabled from json output after deprecation cycle

Since ospf6Enabled and attachedToArea are denoting the same thing.
It is decided to remove ospf6Enabled from json output to make
CLI and json output similar.

Fixes: #9286
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agoMerge pull request #10309 from mobash-rasool/pim6-merge
David Lamparter [Mon, 10 Jan 2022 09:07:56 +0000 (10:07 +0100)]
Merge pull request #10309 from mobash-rasool/pim6-merge

2 years agopimd: API changes to accomodate IPv4 and IPv6
Mobashshera Rasool [Tue, 14 Dec 2021 06:15:23 +0000 (22:15 -0800)]
pimd: API changes to accomodate IPv4 and IPv6

Added apis which will be decided on compile time
for pimd and pim6d daemon
Reviewed-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agodoc: Adding the Design document for PIM IPv6
Mobashshera Rasool [Wed, 8 Dec 2021 15:11:51 +0000 (07:11 -0800)]
doc: Adding the Design document for PIM IPv6

Added the High Level design for implementing MLD and PIMv6.

Added a PPT as well in case someone wants to translate it
to some other language.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopimd: Adding pim_addr as common address for IPv4 and IPv6
Mobashshera Rasool [Tue, 14 Dec 2021 06:10:29 +0000 (22:10 -0800)]
pimd: Adding pim_addr as common address for IPv4 and IPv6

PIM_ADDR will be controlled at compile time for IPv4 and IPv6.
in_addr and in6_addr will be compiled for the respective daemons.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agoMerge pull request #10030 from anlancs/cleanup-reload-null0
Igor Ryzhov [Sun, 9 Jan 2022 14:17:00 +0000 (17:17 +0300)]
Merge pull request #10030 from anlancs/cleanup-reload-null0

tools: cleanup convertion of "Null0"

2 years agoMerge pull request #9517 from anlancs/reload-add-str
Jafar Al-Gharaibeh [Sun, 9 Jan 2022 06:07:53 +0000 (00:07 -0600)]
Merge pull request #9517 from anlancs/reload-add-str

tools: fix wrong get_contexts() of Config class.

2 years agoMerge pull request #10191 from iqras23/bgp_gr
Donatas Abraitis [Sat, 8 Jan 2022 21:07:45 +0000 (23:07 +0200)]
Merge pull request #10191 from iqras23/bgp_gr

bgpd: VRF-Lite fix to clear stale leaked routes

2 years agotests: BGP : Dynamic route leak VRF lite (BGP-GR)
ARShreenidhi [Tue, 14 Dec 2021 05:52:03 +0000 (21:52 -0800)]
tests: BGP : Dynamic route leak VRF lite (BGP-GR)

Authored-by: Shreenidhi A R <rshreenidhi@vmware.com>
Signed-off-by: Shreenidhi A R <rshreenidhi@vmware.com>
2 years agobgpd: VRF-Lite fix to clear stale leaked routes
Kantesh Mundaragi [Fri, 19 Feb 2021 04:48:41 +0000 (20:48 -0800)]
bgpd: VRF-Lite fix to clear stale leaked routes

Description:
Change is intended for fixing the issue related to
clearing of stale leaked routes:
- Whenever BGP goes down,
  after bringing down tcp connection and renegotiating capabilities,
  once we reestablish connection,
  we are not handling clear of VRF leaked route in the bgp_clear_stale_route.

- While bgp is clearing stale routes,
  we need to handle withdraw of routes for VRF route-leaking.

Co-authored-by: Kantesh Mundaragi <kmundaragi@vmware.com>
Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
2 years agoMerge pull request #10288 from ton31337/fix/rfc7300
Donald Sharp [Sat, 8 Jan 2022 13:42:19 +0000 (08:42 -0500)]
Merge pull request #10288 from ton31337/fix/rfc7300

bgpd: Add a warning if we try to use the last reserved ASN

2 years agoMerge pull request #10289 from ton31337/fix/rfc9003
Donald Sharp [Sat, 8 Jan 2022 13:17:25 +0000 (08:17 -0500)]
Merge pull request #10289 from ton31337/fix/rfc9003

bgpd: Extended BGP Administrative Shutdown Communication

2 years agoMerge pull request #10306 from anlancs/bfd-debug-info
Donald Sharp [Sat, 8 Jan 2022 13:09:17 +0000 (08:09 -0500)]
Merge pull request #10306 from anlancs/bfd-debug-info

lib: small debug adjustment for bfd

2 years agoMerge pull request #10242 from anlancs/fix-service-time
Donald Sharp [Sat, 8 Jan 2022 12:15:37 +0000 (07:15 -0500)]
Merge pull request #10242 from anlancs/fix-service-time

build: add "--with-service-timeout" in configure.ac

2 years agopimd: Cleanup weird indentation
Donald Sharp [Thu, 6 Jan 2022 12:30:09 +0000 (07:30 -0500)]
pimd: Cleanup weird indentation

The zlog_warn used to be bounded by a debug guard
but the debug guard was removed but the code was
never fixed up to remove the open and close paranthesis.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobfdd: Clean up some white space snafu's
Donald Sharp [Wed, 5 Jan 2022 21:11:52 +0000 (16:11 -0500)]
bfdd: Clean up some white space snafu's

Found some extra spaces during code inspection.  Let's
get them cleaned up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10305 from mobash-rasool/minor-fixes
Donald Sharp [Sat, 8 Jan 2022 12:08:59 +0000 (07:08 -0500)]
Merge pull request #10305 from mobash-rasool/minor-fixes

pimd: remove redundant header inclusion

2 years agolib: small debug adjustment for bfd
anlan_cs [Sat, 8 Jan 2022 10:45:59 +0000 (05:45 -0500)]
lib: small debug adjustment for bfd

Just use `__func__` to display function name.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2 years agopimd: remove redundant header inclusion
Mobashshera Rasool [Sat, 8 Jan 2022 07:21:00 +0000 (23:21 -0800)]
pimd: remove redundant header inclusion

Just found while code inspection, pim_str.h is included twice.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agotests: Adopt bgp_shutdown_message test to a proper encoding
Donatas Abraitis [Thu, 6 Jan 2022 09:08:17 +0000 (11:08 +0200)]
tests: Adopt bgp_shutdown_message test to a proper encoding

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agodoc: Add rfc9003 to supported BGP RFCs
Donatas Abraitis [Wed, 5 Jan 2022 13:29:00 +0000 (15:29 +0200)]
doc: Add rfc9003 to supported BGP RFCs

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Use correct encoding before printing shutdown msg
Donatas Abraitis [Wed, 5 Jan 2022 13:05:04 +0000 (15:05 +0200)]
bgpd: Use correct encoding before printing shutdown msg

Using `bgp shutdown message MSG...`.

Length should be decoded from the first byte, but it's decoded from the data
instead.

Before:

```
%NOTIFICATION: sent to neighbor 192.168.0.2 6/2 (Cease/Administratively Shutdown) 70 bytes 5b 54 49 43 4b 45 54 2d 31 2d 31 34 33 38 33 36 37 33 39 30 5d 20 73
```

After:

```
%NOTIFICATION: sent to neighbor 192.168.0.2 6/2 (Cease/Administratively Shutdown) "[TICKET-1-1438367390] software upgrade; Expected downtime for 2 hours;"
```

On receiving side:

```
"[TICKET-1-1438367390] software upgrade; Expected downtime for 2 hours;"
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Limit shutdown message size to max 255 characters
Donatas Abraitis [Wed, 5 Jan 2022 13:00:31 +0000 (15:00 +0200)]
bgpd: Limit shutdown message size to max 255 characters

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Increase administrative shutdown message size to 255
Donatas Abraitis [Wed, 5 Jan 2022 10:11:27 +0000 (12:11 +0200)]
bgpd: Increase administrative shutdown message size to 255

Extended BGP Administrative Shutdown Communication (rfc9003):

Basically, shutdown message size is increased to 255 from 128.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Add a warning if we try to use the last reserved ASN
Donatas Abraitis [Wed, 5 Jan 2022 09:42:52 +0000 (11:42 +0200)]
bgpd: Add a warning if we try to use the last reserved ASN

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>