Commit Graph

26797 Commits

Author SHA1 Message Date
Donatas Abraitis
ed284e2338 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>
2022-01-11 17:07:19 +02:00
David Lamparter
0064d4736d
Merge pull request #10212 from mobash-rasool/mld-pim6-dev-prefix 2022-01-11 10:32:16 +01:00
Igor Ryzhov
421ea99ebf
Merge pull request #10313 from anlancs/fix-ospf-check
ospfd,ospf6d: fix wrong comparison of routemap name
2022-01-11 11:32:12 +03:00
sarita patra
ca7613e25a 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>
2022-01-10 21:10:29 -08:00
sarita patra
b7ed98e9b6 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>
2022-01-10 21:10:29 -08:00
sarita patra
d02ea60665 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>
2022-01-10 21:10:29 -08:00
sarita patra
d1257ae9e6 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>
2022-01-10 21:10:29 -08:00
sarita patra
568b78b5bd 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>
2022-01-10 21:10:29 -08:00
Mobashshera Rasool
9040a7f939 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>
2022-01-10 21:10:29 -08:00
Mobashshera Rasool
b050b030e8 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>
2022-01-10 21:10:29 -08:00
Mobashshera Rasool
5e8d3f4f5e 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>
2022-01-10 21:10:29 -08:00
Mobashshera Rasool
12e7634018 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>
2022-01-10 21:10:29 -08:00
Mobashshera Rasool
95d516622b 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>
2022-01-10 21:10:29 -08:00
Mobashshera Rasool
b85201d5cd 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>
2022-01-10 21:10:24 -08:00
anlan_cs
ff5c476dc2 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>
2022-01-10 23:24:24 -05:00
Donatas Abraitis
c274b697ee
Merge pull request #10299 from donaldsharp/various_stuff
Various stuff
2022-01-10 15:10:51 +02:00
David Lamparter
74a88f44c3
Merge pull request #10309 from mobash-rasool/pim6-merge 2022-01-10 10:07:56 +01:00
Mobashshera Rasool
3b37b961c1 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>
2022-01-10 00:24:33 -08:00
Mobashshera Rasool
ec763ad809 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>
2022-01-10 00:16:40 -08:00
Mobashshera Rasool
3e5b708021 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>
2022-01-09 23:51:10 -08:00
Igor Ryzhov
398f41c8bb
Merge pull request #10030 from anlancs/cleanup-reload-null0
tools: cleanup convertion of "Null0"
2022-01-09 17:17:00 +03:00
Jafar Al-Gharaibeh
ca47cd1fb1
Merge pull request #9517 from anlancs/reload-add-str
tools: fix wrong get_contexts() of Config class.
2022-01-09 00:07:53 -06:00
Donatas Abraitis
5d2cd299e1
Merge pull request #10191 from iqras23/bgp_gr
bgpd: VRF-Lite fix to clear stale leaked routes
2022-01-08 23:07:45 +02:00
ARShreenidhi
771ac547f1 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>
2022-01-08 10:21:10 -08:00
Kantesh Mundaragi
641065d4fc 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>
2022-01-08 10:21:10 -08:00
Donald Sharp
0edd8e4714
Merge pull request #10288 from ton31337/fix/rfc7300
bgpd: Add a warning if we try to use the last reserved ASN
2022-01-08 08:42:19 -05:00
Donald Sharp
3284e4dedc
Merge pull request #10289 from ton31337/fix/rfc9003
bgpd: Extended BGP Administrative Shutdown Communication
2022-01-08 08:17:25 -05:00
Donald Sharp
4159ddd043
Merge pull request #10306 from anlancs/bfd-debug-info
lib: small debug adjustment for bfd
2022-01-08 08:09:17 -05:00
Donald Sharp
bcbc98b0b9
Merge pull request #10242 from anlancs/fix-service-time
build: add "--with-service-timeout" in configure.ac
2022-01-08 07:15:37 -05:00
Donald Sharp
dd4a4b5697 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>
2022-01-08 07:11:07 -05:00
Donald Sharp
2d73a32668 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>
2022-01-08 07:11:07 -05:00
Donald Sharp
d91df4d7b7
Merge pull request #10305 from mobash-rasool/minor-fixes
pimd: remove redundant header inclusion
2022-01-08 07:08:59 -05:00
anlan_cs
8b3fd12cda lib: small debug adjustment for bfd
Just use `__func__` to display function name.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2022-01-08 06:01:08 -05:00
Mobashshera Rasool
78d2e63169 pimd: remove redundant header inclusion
Just found while code inspection, pim_str.h is included twice.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-01-07 23:21:00 -08:00
Donatas Abraitis
c5aef655d8 tests: Adopt bgp_shutdown_message test to a proper encoding
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-07 22:35:38 +02:00
Donatas Abraitis
cd9d1a366c doc: Add rfc9003 to supported BGP RFCs
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-07 22:35:38 +02:00
Donatas Abraitis
202a171144 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>
2022-01-07 22:35:38 +02:00
Donatas Abraitis
b776f48c36 bgpd: Limit shutdown message size to max 255 characters
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-07 22:35:38 +02:00
Donatas Abraitis
9f33eea39a 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>
2022-01-07 22:35:38 +02:00
Donatas Abraitis
cc413e2ade bgpd: Add a warning if we try to use the last reserved ASN
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-07 22:35:04 +02:00
Jafar Al-Gharaibeh
541b51a5a3
Merge pull request #10301 from donaldsharp/pim_multicast_fix
tools: Give longer for interface traffic in pim to work
2022-01-07 14:18:08 -06:00
Jafar Al-Gharaibeh
23b43aac0f
Merge pull request #10290 from donaldsharp/nhrp_topo_queries
Nhrp topo queries
2022-01-07 14:00:50 -06:00
Jafar Al-Gharaibeh
c514ba5e66
Merge pull request #10300 from donaldsharp/support_bundle_fix
tools: Run formatter over generate_support_bundle.py
2022-01-07 13:13:14 -06:00
Donald Sharp
758999b3e0 tests: Ensure packets have a chance to arrive in test_multicast_pim_sm_topo4.py
The test is doing this:

a) gather interface data about packets sent
b) shut interface
c) no shut interface
d) gather interface data about packets sent
e) compare a to d and fail if packets sent/received has not incremented

The problem is, of course, that under heavy system load insufficient time
might not have passed for packets to be sent between c and d.  Add up to
35 seconds of looking for packet data being incremented else heavily
loaded systems may never show that data is being sent.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-01-07 11:03:15 -05:00
Donald Sharp
715d3774aa test: Cleanup via black the test_multicast_pim_sm_topo4.py
The test needed some cleanup via black formatting.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-01-07 11:03:15 -05:00
Donald Sharp
0b01a0bbc4 tests: Rename poorly named function
verify_pim_interface_traffic *fetches* the pim
traffic data.  Rename the function to what it
actually does

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-01-07 11:03:15 -05:00
Mark Stapp
9f9efe7efa
Merge pull request #10286 from ton31337/fix/rfc6938
bgpd: Deprecate DPA, ADVERTISER and RCID_PATH path attributes
2022-01-06 12:18:30 -05:00
Donatas Abraitis
812a20dc57 bgpd: Deprecate DPA, ADVERTISER and RCID_PATH path attributes
rfc6938

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-06 17:10:31 +02:00
Donatas Abraitis
dd6c4dc371
Merge pull request #10283 from sworleys/Alpline-Git-Rev
docker: update alpine build enable set own version
2022-01-06 15:37:34 +02:00
Donald Sharp
667cfdc824 tools: Run formatter over generate_support_bundle.py
The generate_support_bundle.py script needs some
reformating to meet our standards

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-01-06 08:18:30 -05:00