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: fix binding to a vrf (backport #8644) #8903

Closed
wants to merge 4 commits into from

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Jun 22, 2021

This is an automatic backport of pull request #8644 done by Mergify.
Cherry-pick of 6768473 has failed:

On branch mergify/bp/dev/8.0/pr-8644
Your branch is up to date with 'origin/dev/8.0'.

You are currently cherry-picking commit 676847384.
  (all conflicts fixed: run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

nothing to commit, working tree clean

Cherry-pick of 36eef85 has failed:

On branch mergify/bp/dev/8.0/pr-8644
Your branch is ahead of 'origin/dev/8.0' by 1 commit.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 36eef8586.
  (all conflicts fixed: run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

nothing to commit, working tree clean

Cherry-pick of 60070c3 has failed:

On branch mergify/bp/dev/8.0/pr-8644
Your branch is ahead of 'origin/dev/8.0' by 2 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 60070c3d0.
  (all conflicts fixed: run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

nothing to commit, working tree clean

Cherry-pick of 75b8d48 has failed:

On branch mergify/bp/dev/8.0/pr-8644
Your branch is ahead of 'origin/dev/8.0' by 3 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 75b8d4823.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   doc/user/zebra.rst

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.io/

idryzhov added 4 commits June 22, 2021 15:16
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit 6768473)
There are two possible use-cases for the `vrf_bind` function:
- bind socket to an interface in a vrf
- bind socket to a vrf device

For the former case, there's one problem - success is returned when the
interface is not found. In that case, the socket is left unbound without
throwing an error.

For the latter case, there are multiple possible problems:
- If the name is not set, then the socket is left unbound (zebra, vrrp).
- If the name is "default" and there's an interface with that name in the
  default VRF, then the socket is bound to that interface.
- In most daemons, if the router is configured before the VRF is actually
  created, we're trying to open and bind the socket right after the
  daemon receives a VRF registration from zebra. We may not receive the
  VRF-interface registration from zebra yet at that point. Therefore,
  `if_lookup_by_name` fails, and the socket is left unbound.

This commit fixes all the issues and updates the function description.

Suggested-by: Pat Ruddy <pat@voltanet.io>
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit 36eef85)
This is not necessary anymore with fixed `vrf_bind`.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit 60070c3)
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit 75b8d48)

# Conflicts:
#	doc/user/zebra.rst
@qlyoung
Copy link
Member

qlyoung commented Jun 22, 2021

Already backported

@mergify mergify bot deleted the mergify/bp/dev/8.0/pr-8644 branch June 22, 2021 15:24
@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: FAILED

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

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 1: Failed (click for details)

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

Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 1:

2021-06-22 19:37:12,191 ERROR: 'router_json_cmp' failed after 121.80 seconds
2021-06-22 19:37:12,193 ERROR: assert failed at "bfd_topo2.test_bfd_topo2/test_protocols_convergence": "r2" JSON output mismatches
assert Generated JSON diff error report:
  
  > $: d2 has key '10.254.254.1/32' which is not present in d1
2021-06-22 19:38:11,765 ERROR: r1: bgpd left a dead pidfile (pid=31054)
2021-06-22 20:05:31,748 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP1U1804AMD64/topotests/lib/bgp.py", line 203, in create_router_bgp
    tgen, router, data_all_bgp, "bgp", build, load_config
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP1U1804AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP1U1804AMD64/topotests/lib/common_config.py", line 605, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: line 6: % Unknown command[27]: neighbor 10.0.0.13 remote-as 0 
% Specify remote-as or peer-group commands first
line 7: Failure to communicate[13] to bgpd, line: neighbor 10.0.0.13 timers 3 10 

line 9: % Unknown command[30]: neighbor fd00:0:0:3::1 remote-as 0 
% Specify remote-as or peer-group commands first
line 11: Failure to communicate[13] to bgpd, line: neighbor fd00:0:0:3::1 activate 

% Specify remote-as or peer-group commands first
line 12: Failure to communicate[13] to bgpd, line: neighbor fd00:0:0:3::1 timers 3 10 

% Specify remote-as or peer-group commands first
line 14: Failure to communicate[13] to bgpd, line: no neighbor fd00:0:0:3::1 activate 



2021-06-22 20:05:32,163 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP1U1804AMD64/topotests/lib/bgp.py", line 203, in create_router_bgp
    tgen, router, data_all_bgp, "bgp", build, load_config
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP1U1804AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP1U1804AMD64/topotests/lib/common_config.py", line 605, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % No BGP process is configured
line 2: Failure to communicate[13] to bgpd, line: no router bgp  



2021-06-22 20:07:56,152 ERROR: r2: zebra left a dead pidfile (pid=14168)

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

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

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.

4 participants