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

zebra: fix FreeBSD breakage #3582

Merged
merged 3 commits into from Jan 8, 2019

Conversation

rzalamena
Copy link
Member

Summary

@mwinter-osr found issues when running ANVL with FreeBSD related with some changes made to the routing socket handling. The issue only seems to happen on boot or when reconfiguring interfaces from scratch.

I've implemented an alternate rta_getattr function to imitate RTA_GETATTR macro to keep the old behavior and fixed a corner case caused by accepting AF_LINK in NETMASK on ifam_read_mesg. Please read the commit messages for more information.

Related Issue

#3538

Components

zebra

When porting routing socket macro data handling to functions, the
attribute function was forgotten. The only difference between the
attribute and address handler is the family type check.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Handle corner case where a warning log message is issued on interface
address netmask handling with sockaddr type AF_LINK: it may come empty
or with match all (all 0xFF).

In the first case all lengths are zero and we only need to copy the
first bytes, second case it comes with a zero index and all 0xFF bytes.

In any case we only need to figure out a few of the first bytes instead
of all data.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
When an empty netmask a wrong end size is calculated, lets handle this
corner case to avoid spurious warning messages.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
@LabN-CI
Copy link
Collaborator

LabN-CI commented Jan 8, 2019

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/3582 2d100aa
Date 01/08/2019
Start 08:39:27
Finish 09:02:57
Run-Time 23:30
Total 1816
Pass 1816
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2019-01-08-08:39:27.txt
Log autoscript-2019-01-08-08:40:10.log.bz2

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: FAILED

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

This is a comment from an EXPERIMENTAL 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 and apply patch from patchwork: Successful

Building Stage: Successful

Basic Tests: Failed

IPv4 ldp protocol on Ubuntu 16.04: Successful
Ubuntu 14.04 deb pkg check: Successful
Addresssanitizer topotest: Successful
Debian 8 deb pkg check: Successful
Fedora 24 rpm pkg check: Successful
Debian 9 deb pkg check: Successful
IPv4 protocols on Ubuntu 14.04: Successful
Topotest tests on Ubuntu 16.04 i386: Successful
CentOS 7 rpm pkg check: Successful
Static analyzer (clang): Successful
Ubuntu 12.04 deb pkg check: Successful
IPv6 protocols on Ubuntu 14.04: Successful
Topology tests on Ubuntu 18.04 amd64: Successful
Ubuntu 16.04 deb pkg check: Successful
CentOS 6 rpm pkg check: Successful

Topology tests on Ubuntu 16.04 amd64: Failed

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPOU1604-6345/test

Topology Tests failed for Topology tests on Ubuntu 16.04 amd64:

*** defaultIntf: warning: r1 has no interfaces
2019-01-08 05:58:33,589 ERROR: 'router_json_cmp' failed after 102.65 seconds
2019-01-08 05:58:33,595 ERROR: assert failed at "test_ldp_vpls_topo1/test_ldp_bindings": "r1" JSON output mismatches the expected result
assert json value is different (
  --- Expected value
  +++ Current value
  @@ -21 +21 @@
  -        "localLabel": "17", 
  +        "localLabel": "18", 
  @@ -29 +29 @@
  -        "localLabel": "17", 
  +        "localLabel": "18", 
  @@ -37 +37 @@
  -        "localLabel": "18", 
  +        "localLabel": "17", 
  @@ -45 +45 @@
  -        "localLabel": "18", 
  +        "localLabel": "17", )
*** defaultIntf: warning: lm has no interfaces

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-6345/artifact/TOPOU1604/ErrorLog/log_topotests.txt

Topology Tests memory analysis: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-6345/artifact/TOPOU1604/MemoryLeaks/

Warnings Generated during build:

Checkout code: Successful with additional warnings:

Topology tests on Ubuntu 16.04 amd64: Failed

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPOU1604-6345/test

Topology Tests failed for Topology tests on Ubuntu 16.04 amd64:

*** defaultIntf: warning: r1 has no interfaces
2019-01-08 05:58:33,589 ERROR: 'router_json_cmp' failed after 102.65 seconds
2019-01-08 05:58:33,595 ERROR: assert failed at "test_ldp_vpls_topo1/test_ldp_bindings": "r1" JSON output mismatches the expected result
assert json value is different (
  --- Expected value
  +++ Current value
  @@ -21 +21 @@
  -        "localLabel": "17", 
  +        "localLabel": "18", 
  @@ -29 +29 @@
  -        "localLabel": "17", 
  +        "localLabel": "18", 
  @@ -37 +37 @@
  -        "localLabel": "18", 
  +        "localLabel": "17", 
  @@ -45 +45 @@
  -        "localLabel": "18", 
  +        "localLabel": "17", )
*** defaultIntf: warning: lm has no interfaces

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-6345/artifact/TOPOU1604/ErrorLog/log_topotests.txt

Report for kernel_socket.c | 4 issues
===============================================
< WARNING: externs should be avoided in .c files
< #236: FILE: /tmp/f1-26984/kernel_socket.c:236:
< WARNING: externs should be avoided in .c files
< #238: FILE: /tmp/f1-26984/kernel_socket.c:238:

Warnings Generated during build:

Ubuntu 16.04 i386 build: Successful with additional warnings:

Debian Package lintian failed for Ubuntu 16.04 i386 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-6345/artifact/U1604I386/ErrorLog/log_lintian.txt)

W: frr: package-name-doesnt-match-sonames libfrr0 libfrrospfapiclient0
N: 3 tags overridden (3 warnings)

Debian 9 amd64 build: Successful with additional warnings:

Debian Package lintian failed for Debian 9 amd64 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-6345/artifact/CI021BUILD/ErrorLog/log_lintian.txt)

W: frr: package-name-doesnt-match-sonames libfrr0 libfrrospfapiclient0
N: 3 tags overridden (3 warnings)

Ubuntu 16.04 amd64 build: Successful with additional warnings:

Debian Package lintian failed for Ubuntu 16.04 amd64 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-6345/artifact/CI014BUILD/ErrorLog/log_lintian.txt)

W: frr: package-name-doesnt-match-sonames libfrr0 libfrrospfapiclient0
N: 3 tags overridden (3 warnings)

Ubuntu 18.04 amd64 build: Successful with additional warnings:

Debian Package lintian failed for Ubuntu 18.04 amd64 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-6345/artifact/U1804AMD64/ErrorLog/log_lintian.txt)

W: frr: package-name-doesnt-match-sonames libfrr0 libfrrospfapiclient0
N: 4 tags overridden (3 warnings, 1 info)

Ubuntu 14.04 amd64 build: Successful with additional warnings:

Debian Package lintian failed for Ubuntu 14.04 amd64 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-6345/artifact/CI001BUILD/ErrorLog/log_lintian.txt)

W: frr: package-name-doesnt-match-sonames libfrr0 libfrrospfapiclient0
N: 3 tags overridden (3 warnings)

Debian 8 amd64 build: Successful with additional warnings:

Debian Package lintian failed for Debian 8 amd64 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-6345/artifact/CI008BLD/ErrorLog/log_lintian.txt)

W: frr: package-name-doesnt-match-sonames libfrr0 libfrrospfapiclient0
N: 3 tags overridden (3 warnings)

CLANG Static Analyzer Summary

  • Github Pull Request 3582, comparing to Git base SHA fe615b5

No Changes in Static Analysis warnings compared to base

@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-FRRPULLREQ-6345/

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


Warnings Generated during build:

Checkout code: Successful with additional warnings:

Report for kernel_socket.c | 4 issues
===============================================
< WARNING: externs should be avoided in .c files
< #236: FILE: /tmp/f1-26984/kernel_socket.c:236:
< WARNING: externs should be avoided in .c files
< #238: FILE: /tmp/f1-26984/kernel_socket.c:238:

Warnings Generated during build:

Ubuntu 16.04 i386 build: Successful with additional warnings:

Debian Package lintian failed for Ubuntu 16.04 i386 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-6345/artifact/U1604I386/ErrorLog/log_lintian.txt)

W: frr: package-name-doesnt-match-sonames libfrr0 libfrrospfapiclient0
N: 3 tags overridden (3 warnings)

Debian 9 amd64 build: Successful with additional warnings:

Debian Package lintian failed for Debian 9 amd64 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-6345/artifact/CI021BUILD/ErrorLog/log_lintian.txt)

W: frr: package-name-doesnt-match-sonames libfrr0 libfrrospfapiclient0
N: 3 tags overridden (3 warnings)

Ubuntu 16.04 amd64 build: Successful with additional warnings:

Debian Package lintian failed for Ubuntu 16.04 amd64 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-6345/artifact/CI014BUILD/ErrorLog/log_lintian.txt)

W: frr: package-name-doesnt-match-sonames libfrr0 libfrrospfapiclient0
N: 3 tags overridden (3 warnings)

Ubuntu 18.04 amd64 build: Successful with additional warnings:

Debian Package lintian failed for Ubuntu 18.04 amd64 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-6345/artifact/U1804AMD64/ErrorLog/log_lintian.txt)

W: frr: package-name-doesnt-match-sonames libfrr0 libfrrospfapiclient0
N: 4 tags overridden (3 warnings, 1 info)

Ubuntu 14.04 amd64 build: Successful with additional warnings:

Debian Package lintian failed for Ubuntu 14.04 amd64 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-6345/artifact/CI001BUILD/ErrorLog/log_lintian.txt)

W: frr: package-name-doesnt-match-sonames libfrr0 libfrrospfapiclient0
N: 3 tags overridden (3 warnings)

Debian 8 amd64 build: Successful with additional warnings:

Debian Package lintian failed for Debian 8 amd64 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-6345/artifact/CI008BLD/ErrorLog/log_lintian.txt)

W: frr: package-name-doesnt-match-sonames libfrr0 libfrrospfapiclient0
N: 3 tags overridden (3 warnings)

CLANG Static Analyzer Summary

  • Github Pull Request 3582, comparing to Git base SHA fe615b5

No Changes in Static Analysis warnings compared to base

@donaldsharp donaldsharp merged commit 83ede3e into FRRouting:master Jan 8, 2019
@rzalamena rzalamena deleted the freebsd-route-fix branch January 8, 2019 15:43
Copy link
Contributor

@mjstapp mjstapp left a comment

Choose a reason for hiding this comment

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

Nice tracking this down - I had a small question about the naming of the helper function?

@@ -245,9 +247,10 @@ static inline int af_check(int family)
return 0;
}

size_t rta_get(caddr_t sap, void *destp, size_t destlen)
size_t _rta_get(caddr_t sap, void *destp, size_t destlen, bool checkaf)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be 'static', since it's an internal/utility function? Also, I don't love the little leading underscore name - could the name be a bit clearer, like 'rta_get_helper' or 'rta_get_internal' ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants