Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bgp coverity fix #13864

Merged
merged 2 commits into from
Jun 29, 2023
Merged

Bgp coverity fix #13864

merged 2 commits into from
Jun 29, 2023

Conversation

pguibert6WIND
Copy link
Member

coverity fixes

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Jun 27, 2023

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-12581/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source / Pull Request: Successful

Building Stage: Successful

Basic Tests: Failed

Topotests Ubuntu 18.04 amd64 part 6: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO6U18AMD64-12581/test

Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 6
see full log at https://ci1.netdef.org/browse/FRR-PULLREQ2-12581/artifact/TOPO6U18AMD64/TopotestLogs/log_topotests.txt
Topotests Ubuntu 18.04 amd64 part 6: Unknown Log
URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-12581/artifact/TOPO6U18AMD64/TopotestDetails/

Topotests debian 10 amd64 part 3: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO3DEB10AMD64-12581/test

Topology Tests failed for Topotests debian 10 amd64 part 3
see full log at https://ci1.netdef.org/browse/FRR-PULLREQ2-12581/artifact/TOPO3DEB10AMD64/TopotestLogs/log_topotests.txt
Topotests debian 10 amd64 part 3: Unknown Log
URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-12581/artifact/TOPO3DEB10AMD64/TopotestDetails/

Successful on other platforms/tests
  • CentOS 7 rpm pkg check
  • Topotests Ubuntu 18.04 i386 part 9
  • Addresssanitizer topotests part 6
  • Topotests debian 10 amd64 part 1
  • Static analyzer (clang)
  • Topotests Ubuntu 18.04 amd64 part 1
  • Topotests Ubuntu 18.04 i386 part 5
  • Topotests debian 10 amd64 part 2
  • Topotests Ubuntu 18.04 i386 part 0
  • Topotests debian 10 amd64 part 7
  • Topotests Ubuntu 18.04 arm8 part 0
  • Topotests Ubuntu 18.04 amd64 part 8
  • Addresssanitizer topotests part 0
  • Ubuntu 18.04 deb pkg check
  • Topotests Ubuntu 18.04 arm8 part 1
  • Topotests debian 10 amd64 part 6
  • Topotests Ubuntu 18.04 arm8 part 6
  • Addresssanitizer topotests part 1
  • Topotests Ubuntu 18.04 i386 part 4
  • Addresssanitizer topotests part 4
  • Debian 9 deb pkg check
  • Topotests debian 10 amd64 part 5
  • Addresssanitizer topotests part 8
  • Topotests Ubuntu 18.04 i386 part 7
  • Topotests Ubuntu 18.04 i386 part 2
  • Topotests debian 10 amd64 part 4
  • Topotests Ubuntu 18.04 arm8 part 8
  • Addresssanitizer topotests part 7
  • Topotests Ubuntu 18.04 amd64 part 3
  • Topotests Ubuntu 18.04 arm8 part 3
  • Topotests debian 10 amd64 part 9
  • Addresssanitizer topotests part 5
  • Topotests Ubuntu 18.04 i386 part 6
  • Topotests Ubuntu 18.04 amd64 part 2
  • Topotests debian 10 amd64 part 8
  • Topotests Ubuntu 18.04 amd64 part 4
  • Topotests Ubuntu 18.04 i386 part 1
  • Addresssanitizer topotests part 2
  • Topotests Ubuntu 18.04 arm8 part 9
  • Ubuntu 20.04 deb pkg check
  • Topotests Ubuntu 18.04 amd64 part 5
  • Debian 10 deb pkg check
  • Topotests Ubuntu 18.04 amd64 part 0
  • Addresssanitizer topotests part 3
  • Topotests Ubuntu 18.04 amd64 part 7
  • Topotests Ubuntu 18.04 arm8 part 2
  • Topotests debian 10 amd64 part 0
  • Topotests Ubuntu 18.04 amd64 part 9
  • Addresssanitizer topotests part 9
  • Topotests Ubuntu 18.04 arm8 part 7
  • Topotests Ubuntu 18.04 i386 part 8
  • Topotests Ubuntu 18.04 i386 part 3

Warnings Generated during build:

Checkout code: Successful with additional warnings
Topotests Ubuntu 18.04 amd64 part 6: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO6U18AMD64-12581/test

Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 6
see full log at https://ci1.netdef.org/browse/FRR-PULLREQ2-12581/artifact/TOPO6U18AMD64/TopotestLogs/log_topotests.txt
Topotests Ubuntu 18.04 amd64 part 6: Unknown Log
URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-12581/artifact/TOPO6U18AMD64/TopotestDetails/

Topotests debian 10 amd64 part 3: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO3DEB10AMD64-12581/test

Topology Tests failed for Topotests debian 10 amd64 part 3
see full log at https://ci1.netdef.org/browse/FRR-PULLREQ2-12581/artifact/TOPO3DEB10AMD64/TopotestLogs/log_topotests.txt
Topotests debian 10 amd64 part 3: Unknown Log
URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-12581/artifact/TOPO3DEB10AMD64/TopotestDetails/

Report for bgp_mplsvpn.c | 26 issues
===============================================
< ERROR: code indent should use tabs where possible
< #4243: FILE: /tmp/f1-2497089/bgp_mplsvpn.c:4243:
< ERROR: code indent should use tabs where possible
< #4244: FILE: /tmp/f1-2497089/bgp_mplsvpn.c:4244:
< WARNING: please, no spaces at the start of a line
< #4244: FILE: /tmp/f1-2497089/bgp_mplsvpn.c:4244:
< ERROR: code indent should use tabs where possible
< #4245: FILE: /tmp/f1-2497089/bgp_mplsvpn.c:4245:
< WARNING: please, no spaces at the start of a line
< #4245: FILE: /tmp/f1-2497089/bgp_mplsvpn.c:4245:
< ERROR: code indent should use tabs where possible
< #4246: FILE: /tmp/f1-2497089/bgp_mplsvpn.c:4246:
< WARNING: please, no spaces at the start of a line
< #4246: FILE: /tmp/f1-2497089/bgp_mplsvpn.c:4246:
< ERROR: code indent should use tabs where possible
< #4247: FILE: /tmp/f1-2497089/bgp_mplsvpn.c:4247:
< WARNING: please, no spaces at the start of a line
< #4247: FILE: /tmp/f1-2497089/bgp_mplsvpn.c:4247:
< ERROR: code indent should use tabs where possible
< #4248: FILE: /tmp/f1-2497089/bgp_mplsvpn.c:4248:
< WARNING: please, no spaces at the start of a line
< #4248: FILE: /tmp/f1-2497089/bgp_mplsvpn.c:4248:
< ERROR: code indent should use tabs where possible
< #4249: FILE: /tmp/f1-2497089/bgp_mplsvpn.c:4249:
< WARNING: please, no spaces at the start of a line
< #4249: FILE: /tmp/f1-2497089/bgp_mplsvpn.c:4249:

@@ -3990,7 +3990,7 @@ static void bgp_mplsvpn_nh_label_bind_send_nexthop_label(
{
struct prefix pfx_nh, *p = NULL;
uint32_t num_labels = 0, lsp_num_labels;
mpls_label_t label[MPLS_MAX_LABELS];
mpls_label_t label[MPLS_MAX_LABELS + 1];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we fix this part instead?

			if (nh->nh_label->num_labels >
			    MPLS_MAX_LABELS - num_labels)
				lsp_num_labels = MPLS_MAX_LABELS - num_labels;
			else
				lsp_num_labels = nh->nh_label->num_labels;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, you re right.
done

Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two nits, and LGTM.

bgpd/bgp_mplsvpn.c Outdated Show resolved Hide resolved
bgpd/bgp_mplsvpn.c Outdated Show resolved Hide resolved
@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Jun 28, 2023

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-12604/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source / Pull Request: Successful

Building Stage: Successful

Basic Tests: Failed

Topotests Ubuntu 18.04 arm8 part 8: Failed (click for details) Topotests Ubuntu 18.04 arm8 part 8: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-12604/artifact/TOPO8U18AMD64/TopotestDetails/ Topotests Ubuntu 18.04 arm8 part 8: No useful log found
Successful on other platforms/tests
  • Topotests debian 10 amd64 part 6
  • Topotests Ubuntu 18.04 arm8 part 6
  • Topotests Ubuntu 18.04 arm8 part 1
  • Topotests Ubuntu 18.04 amd64 part 0
  • Addresssanitizer topotests part 3
  • Topotests Ubuntu 18.04 amd64 part 7
  • Topotests Ubuntu 18.04 i386 part 5
  • Addresssanitizer topotests part 2
  • CentOS 7 rpm pkg check
  • Topotests Ubuntu 18.04 amd64 part 4
  • Topotests debian 10 amd64 part 7
  • Topotests Ubuntu 18.04 amd64 part 3
  • Addresssanitizer topotests part 8
  • Topotests Ubuntu 18.04 i386 part 2
  • Topotests debian 10 amd64 part 5
  • Topotests Ubuntu 18.04 i386 part 0
  • Ubuntu 18.04 deb pkg check
  • Topotests Ubuntu 18.04 i386 part 7
  • Addresssanitizer topotests part 6
  • Topotests Ubuntu 18.04 amd64 part 1
  • Topotests Ubuntu 18.04 i386 part 3
  • Topotests Ubuntu 18.04 i386 part 8
  • Topotests Ubuntu 18.04 amd64 part 2
  • Topotests debian 10 amd64 part 3
  • Topotests debian 10 amd64 part 8
  • Topotests Ubuntu 18.04 amd64 part 6
  • Addresssanitizer topotests part 0
  • Topotests debian 10 amd64 part 9
  • Topotests Ubuntu 18.04 arm8 part 9
  • Debian 9 deb pkg check
  • Addresssanitizer topotests part 4
  • Addresssanitizer topotests part 1
  • Topotests Ubuntu 18.04 i386 part 4
  • Topotests Ubuntu 18.04 arm8 part 3
  • Topotests debian 10 amd64 part 4
  • Addresssanitizer topotests part 9
  • Topotests debian 10 amd64 part 2
  • Topotests Ubuntu 18.04 i386 part 9
  • Topotests Ubuntu 18.04 arm8 part 0
  • Topotests Ubuntu 18.04 arm8 part 7
  • Topotests Ubuntu 18.04 amd64 part 8
  • Topotests Ubuntu 18.04 arm8 part 2
  • Static analyzer (clang)
  • Topotests debian 10 amd64 part 0
  • Addresssanitizer topotests part 7
  • Topotests Ubuntu 18.04 amd64 part 9
  • Ubuntu 20.04 deb pkg check
  • Topotests Ubuntu 18.04 i386 part 6
  • Debian 10 deb pkg check
  • Topotests Ubuntu 18.04 amd64 part 5
  • Addresssanitizer topotests part 5
  • Topotests debian 10 amd64 part 1
  • Topotests Ubuntu 18.04 i386 part 1

Warnings Generated during build:

Checkout code: Successful with additional warnings
Topotests Ubuntu 18.04 arm8 part 8: Failed (click for details) Topotests Ubuntu 18.04 arm8 part 8: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-12604/artifact/TOPO8U18AMD64/TopotestDetails/ Topotests Ubuntu 18.04 arm8 part 8: No useful log found
<stdin>:16: space before tab in indent.
        	                   */
warning: 1 line adds whitespace errors.
Report for bgp_mplsvpn.c | 32 issues
===============================================
< ERROR: code indent should use tabs where possible
< #4028: FILE: /tmp/f1-1430692/bgp_mplsvpn.c:4028:
< WARNING: please, no space before tabs
< #4028: FILE: /tmp/f1-1430692/bgp_mplsvpn.c:4028:
< WARNING: Block comments should align the * on each line
< #4028: FILE: /tmp/f1-1430692/bgp_mplsvpn.c:4028:
< ERROR: code indent should use tabs where possible
< #4250: FILE: /tmp/f1-1430692/bgp_mplsvpn.c:4250:
< ERROR: code indent should use tabs where possible
< #4251: FILE: /tmp/f1-1430692/bgp_mplsvpn.c:4251:
< WARNING: please, no spaces at the start of a line
< #4251: FILE: /tmp/f1-1430692/bgp_mplsvpn.c:4251:
< ERROR: code indent should use tabs where possible
< #4252: FILE: /tmp/f1-1430692/bgp_mplsvpn.c:4252:
< WARNING: please, no spaces at the start of a line
< #4252: FILE: /tmp/f1-1430692/bgp_mplsvpn.c:4252:
< ERROR: code indent should use tabs where possible
< #4253: FILE: /tmp/f1-1430692/bgp_mplsvpn.c:4253:
< WARNING: please, no spaces at the start of a line
< #4253: FILE: /tmp/f1-1430692/bgp_mplsvpn.c:4253:
< ERROR: code indent should use tabs where possible
< #4254: FILE: /tmp/f1-1430692/bgp_mplsvpn.c:4254:
< WARNING: please, no spaces at the start of a line
< #4254: FILE: /tmp/f1-1430692/bgp_mplsvpn.c:4254:
< ERROR: code indent should use tabs where possible
< #4255: FILE: /tmp/f1-1430692/bgp_mplsvpn.c:4255:
< WARNING: please, no spaces at the start of a line
< #4255: FILE: /tmp/f1-1430692/bgp_mplsvpn.c:4255:
< ERROR: code indent should use tabs where possible
< #4256: FILE: /tmp/f1-1430692/bgp_mplsvpn.c:4256:
< WARNING: please, no spaces at the start of a line
< #4256: FILE: /tmp/f1-1430692/bgp_mplsvpn.c:4256:

The bmnc pointer is never null. Do not keep the test
on the pointer.

Fixes: 1069425 ("bgpd: allocate label bound to received mpls vpn routes")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
In case the full label stack is used, there may be
a table overrun happening. Avoid it by increasing the
size of the table.

Fixes: 27f4dee ("bgpd: update the mpls entry to handle return traffic")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Jun 28, 2023

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-12618/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source / Pull Request: Successful

Building Stage: Successful

Basic Tests: Failed

Topotests Ubuntu 18.04 amd64 part 4: Failed (click for details) Topotests Ubuntu 18.04 amd64 part 4: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-12618/artifact/TP4U1804AMD64/TopotestDetails/

Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TP4U1804AMD64-12618/test

Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 4
see full log at https://ci1.netdef.org/browse/FRR-PULLREQ2-12618/artifact/TP4U1804AMD64/TopotestLogs/log_topotests.txt

Topotests Ubuntu 18.04 i386 part 9: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO9U18I386-12618/test

Topology Tests failed for Topotests Ubuntu 18.04 i386 part 9
see full log at https://ci1.netdef.org/browse/FRR-PULLREQ2-12618/artifact/TOPO9U18I386/TopotestLogs/log_topotests.txt
Topotests Ubuntu 18.04 i386 part 9: Unknown Log
URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-12618/artifact/TOPO9U18I386/TopotestDetails/

Successful on other platforms/tests
  • Topotests Ubuntu 18.04 i386 part 6
  • Topotests Ubuntu 18.04 i386 part 1
  • Addresssanitizer topotests part 2
  • Topotests Ubuntu 18.04 amd64 part 5
  • Topotests Ubuntu 18.04 arm8 part 1
  • Topotests Ubuntu 18.04 arm8 part 7
  • Addresssanitizer topotests part 9
  • Topotests Ubuntu 18.04 amd64 part 7
  • Topotests Ubuntu 18.04 arm8 part 6
  • Topotests debian 10 amd64 part 6
  • Topotests Ubuntu 18.04 i386 part 2
  • Topotests debian 10 amd64 part 5
  • Topotests debian 10 amd64 part 0
  • Topotests Ubuntu 18.04 arm8 part 2
  • Addresssanitizer topotests part 3
  • Topotests Ubuntu 18.04 arm8 part 8
  • Topotests debian 10 amd64 part 9
  • Topotests Ubuntu 18.04 i386 part 7
  • Addresssanitizer topotests part 6
  • CentOS 7 rpm pkg check
  • Topotests Ubuntu 18.04 amd64 part 2
  • Topotests Ubuntu 18.04 amd64 part 3
  • Topotests Ubuntu 18.04 amd64 part 0
  • Topotests debian 10 amd64 part 7
  • Topotests Ubuntu 18.04 i386 part 5
  • Topotests Ubuntu 18.04 i386 part 0
  • Topotests debian 10 amd64 part 8
  • Ubuntu 20.04 deb pkg check
  • Topotests Ubuntu 18.04 arm8 part 9
  • Debian 10 deb pkg check
  • Topotests debian 10 amd64 part 3
  • Debian 9 deb pkg check
  • Topotests Ubuntu 18.04 amd64 part 1
  • Addresssanitizer topotests part 1
  • Topotests Ubuntu 18.04 i386 part 4
  • Ubuntu 18.04 deb pkg check
  • Topotests Ubuntu 18.04 i386 part 3
  • Topotests Ubuntu 18.04 amd64 part 6
  • Topotests Ubuntu 18.04 i386 part 8
  • Addresssanitizer topotests part 8
  • Topotests Ubuntu 18.04 amd64 part 9
  • Addresssanitizer topotests part 7
  • Topotests debian 10 amd64 part 4
  • Addresssanitizer topotests part 4
  • Addresssanitizer topotests part 5
  • Topotests Ubuntu 18.04 arm8 part 3
  • Topotests debian 10 amd64 part 1
  • Topotests Ubuntu 18.04 amd64 part 8
  • Topotests debian 10 amd64 part 2
  • Topotests Ubuntu 18.04 arm8 part 0
  • Static analyzer (clang)
  • Addresssanitizer topotests part 0

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-12618/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

@ton31337 ton31337 merged commit 1ce1c53 into FRRouting:master Jun 29, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants