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

lib: enforce vrf netns if setns() returns ok #1880

Merged
merged 2 commits into from
Mar 14, 2018

Conversation

pguibert6WIND
Copy link
Member

On some cases, having vrf netns support does not only rely on the
ability to have vrf on /var/run/netns. For each new netns detected,
a call to setns() will be done to check that the feature is well
available.

Signed-off-by: Philippe Guibert philippe.guibert@6wind.com

@LabN-CI
Copy link
Collaborator

LabN-CI commented Mar 13, 2018

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/1880 f0c4314
Date 03/13/2018
Start 07:40:16
Finish 08:03:22
Run-Time 23:06
Total 1813
Pass 1813
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2018-03-13-07:40:16.txt
Log autoscript-2018-03-13-07:40:56.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-2863/

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

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

Topology tests on Ubuntu 16.04 amd64: Failed

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

Topology Tests failed for Topology tests on Ubuntu 16.04 amd64:

2018-03-13 05:15:44,611 ERROR: assert failed at "bgp_vrf_netns.test_bgp_vrf_netns_topo/test_bgp_convergence": BGP router network did not converge
assert json["ipv4Unicast"]["peers"]["10.0.1.101"]["state"] value is different (
  --- Expected value
  +++ Current value
  @@ -1 +1 @@
  -"Established"
  +"Idle")
  json["ipv4Unicast"]["peers"]["10.0.1.101"]["prefixReceivedCount"] value is different (
  --- Expected value
  +++ Current value
  @@ -1 +1 @@
  -10
  +0)
2018-03-13 05:15:47,875 ERROR: assert failed at "bgp_vrf_netns.test_bgp_vrf_netns_topo/test_bgp_vrf_netns": expected routes in "show ip bgp vrf r1-cust1 ipv4" output
assert expected key(s) ['10.201.3.0/24', '10.201.6.0/24', '10.201.5.0/24', '10.201.8.0/24', '10.201.9.0/24', '10.201.0.0/24', '10.201.2.0/24', '10.201.1.0/24', '10.201.4.0/24', '10.201.7.0/24'] in json["routes"] (have []):
  --- Expected value
  +++ Current value
  @@ -1,52 +1 @@
  -{
  -    "10.201.0.0/24": [
  -        {
  -            "valid": true
  -        }
  -    ], 
  -    "10.201.1.0/24": [
  -        {
  -            "valid": true
  -        }
  -    ], 
  -    "10.201.2.0/24": [
  -        {
  -            "valid": true
  -        }
  -    ], 
  -    "10.201.3.0/24": [
  -        {
  -            "valid": true
  -        }
  -    ], 
  -    "10.201.4.0/24": [
  -        {
  -            "valid": true
  -        }
  -    ], 
  -    "10.201.5.0/24": [
  -        {
  -            "valid": true
  -        }
  -    ], 
  -    "10.201.6.0/24": [
  -        {
  -            "valid": true
  -        }
  -    ], 
  -    "10.201.7.0/24": [
  -        {
  -            "valid": true
  -        }
  -    ], 
  -    "10.201.8.0/24": [
  -        {
  -            "valid": true
  -        }
  -    ], 
  -    "10.201.9.0/24": [
  -        {
  -            "valid": true
  -        }
  -    ]
  -}
  +{}

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

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

CLANG Static Analyzer Summary

  • Github Pull Request 1880, comparing to Git base SHA c1a0038

No Changes in Static Analysis warnings compared to base

19 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2863/artifact/shared/static_analysis/index.html

@LabN-CI
Copy link
Collaborator

LabN-CI commented Mar 13, 2018

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/1880 11c0888
Date 03/13/2018
Start 09:25:19
Finish 09:48:26
Run-Time 23:07
Total 1816
Pass 1816
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2018-03-13-09:25:19.txt
Log autoscript-2018-03-13-09:25:59.log.bz2

For details, please contact louberger

@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-2864/

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.


CLANG Static Analyzer Summary

  • Github Pull Request 1880, comparing to Git base SHA c1a0038

No Changes in Static Analysis warnings compared to base

19 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2864/artifact/shared/static_analysis/index.html

@LabN-CI
Copy link
Collaborator

LabN-CI commented Mar 13, 2018

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/1880 932001d
Date 03/13/2018
Start 10:00:24
Finish 10:23:32
Run-Time 23:08
Total 1813
Pass 1813
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2018-03-13-10:00:24.txt
Log autoscript-2018-03-13-10:01:04.log.bz2

For details, please contact louberger

@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-2865/

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.


CLANG Static Analyzer Summary

  • Github Pull Request 1880, comparing to Git base SHA c1a0038

No Changes in Static Analysis warnings compared to base

19 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2865/artifact/shared/static_analysis/index.html

@pguibert6WIND pguibert6WIND force-pushed the enforce_vrf_netns_enable branch from 932001d to 3bc3490 Compare March 13, 2018 15:00
In order to create the netns context, the zebra parser at startup needs
to have its privileges raised.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Vty commands that link netns context to a vrf is requiring some
privileges. The change consists in retrieving the privileges at the
vrf_cmd_init() called by the relevant daemon. Then use it.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
@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-2867/

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.


CLANG Static Analyzer Summary

  • Github Pull Request 1880, comparing to Git base SHA c1a0038

No Changes in Static Analysis warnings compared to base

19 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2867/artifact/shared/static_analysis/index.html

@donaldsharp donaldsharp self-requested a review March 13, 2018 15:59
@LabN-CI
Copy link
Collaborator

LabN-CI commented Mar 13, 2018

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/1880 3bc3490
Date 03/13/2018
Start 11:40:20
Finish 12:03:29
Run-Time 23:09
Total 1816
Pass 1816
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2018-03-13-11:40:20.txt
Log autoscript-2018-03-13-11:41:00.log.bz2

For details, please contact louberger

@@ -92,7 +92,11 @@ static void zebra_ns_notify_create_context_from_entry_name(const char *name)
zlog_warn("NS notify : failed to create VRF %s", name);
return;
}
if (zserv_privs.change(ZPRIVS_RAISE))
zlog_err("Can't raise privileges");
ret = vrf_netns_handler_create(NULL, vrf, netnspath, ns_id);
Copy link
Member

Choose a reason for hiding this comment

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

why do we sometimes need to raise priviledges to call this function and sometimes we do not?

Copy link
Member Author

Choose a reason for hiding this comment

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

now, on every place where vrf_netns_handler_create() is called, we try to raise the privilege level.

Copy link
Member Author

Choose a reason for hiding this comment

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

There is no reason to raise privileges sometimes and other times not.
this is why I make that patch.

@donaldsharp donaldsharp merged commit 9fb9dfd into FRRouting:master Mar 14, 2018
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.

4 participants