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

ipv6: Make IPAddrToHWAddr() aware of IPv6 #101

Merged
merged 2 commits into from
Feb 26, 2020

Conversation

danwinship
Copy link
Contributor

I had a problem in an IPv6 cluster where certain traffic was getting
dropped.  A closer look revealed that duplicate MACs had been
configured in the OVN virtual network topology.  In particular, the
join bridge between the gateway router and distributed cluster router
had the same MAC on both of its ports.

The root cause was this function.  It assumed IPv4.

While working on a fix for this and writing test cases, I discovered
that the function would sometimes also break for IPv4.  It assumed
that the IPv4 address was always in 4-byte form.  Sometimes the IP
type actually has 16 bytes, even when holding an IPv4 address.  The
first fix is to ensure that we're always using the 4-byte
representation when working with the IPv4 address.

The second fix is to make this function aware of IPv6.  We have more
bytes in the address than we have bytes in a MAC, so it's not
technically possible to always guarantee this results in a unique mac.
However, the subnets we have hard coded internally in OVN are of a
pretty simple format like fd98::N, so using the first two and last two
bytes seems good enough.

Really it's better to just generate a random unique MAC, but this
patch attempts a compromise by covering some cases without
re-introducing the performance concern that was addressed when this
code was first introduced by commit
b453f73.

Signed-off-by: Russell Bryant <russell@ovn.org>
This is a follow up after some discussion on PR openshift#1091.  Even with this
limitation in place, we will still end up with some duplicate MACs in
a system.  The duplicates won't be on the same logical switch though,
so it's not harmful.  The cluster subnet doesn't change this
situation.
@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 25, 2020
@russellb
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 25, 2020
Copy link
Contributor

@knobunc knobunc left a comment

Choose a reason for hiding this comment

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

/lgtm

I don't really like this, but for a short-term solution it's acceptable.

Copy link
Contributor

@pecameron pecameron left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danwinship, knobunc, pecameron, russellb

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [danwinship,knobunc,pecameron]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@danwinship
Copy link
Contributor Author

/retest

1 similar comment
@russellb
Copy link
Member

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 3a13093 into openshift:master Feb 26, 2020
@openshift-ci-robot
Copy link
Contributor

@danwinship: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-gcp-ovn de13532 link /test e2e-gcp-ovn

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants