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

Set MAC on host side of veth pair #436

Merged
merged 1 commit into from
Nov 29, 2017

Conversation

tmjd
Copy link
Member

@tmjd tmjd commented Nov 27, 2017

  • Applied changes made on v2.0-beta (Calico v3.0-beta)
  • Setting the MAC address avoids issues when kernel fails to generate a
    persistent MAC address
The host side of veth pairs will be set with MAC 'ee:ee:ee:ee:ee:ee', if setting that fails then the previous behavior of a kernel generated MAC will be used.

@tmjd tmjd added this to the Calico v2.6.4 milestone Nov 27, 2017
@tmjd
Copy link
Member Author

tmjd commented Nov 27, 2017

I put hold-merge on since this I am assuming we don't want to add this to the v2.6.3 release which is on the verge of being cut.

@tmjd
Copy link
Member Author

tmjd commented Nov 27, 2017

Need to make sure the FAQ entry in projectcalico/calico#1394 is added to the v2.6 docs when this PR is ready for to go into a v2.6 release

Copy link
Contributor

@bcreane bcreane left a comment

Choose a reason for hiding this comment

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

lgtm.

utils/network.go Outdated
@@ -57,6 +57,18 @@ func DoNetworking(args *skel.CmdArgs, conf NetConf, result *current.Result, logg
return err
}

mac, err := net.ParseMAC("EE:EE:EE:EE:EE:EE")
if err != nil {
return fmt.Errorf("failed to parse MAC Address: %v", err)
Copy link
Member

Choose a reason for hiding this comment

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

Hm, wondering if we should return an error in these cases, or just log an error.

thought process is - we don't do this today and it works on most systems, should we just fall back to today's behavior if for some reason we fail to set the mac on a given system?

Copy link
Member

Choose a reason for hiding this comment

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

@tmjd @fasaxc WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense to me. Just log an error and only do LinkSetHardwareAddr if it is successful.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, and if LinkSetHardwareAddr fails then we carry on as normal (but log an error).

Copy link
Member

Choose a reason for hiding this comment

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

Sounds fine to me. (TBH, I'd be tempted to panic if parsing a fixed MAC fails. That should work 100% of the time so the most likely scenario for that to fail is if we accidentally introduced a typo into the MAC during maintenance.)

- Use hardcoded MAC of EE:EE:EE:EE:EE:EE
  (matchs libnetwork)
- If there is an error log message and fallback
  to kernel provided MAC
@tmjd tmjd removed the hold-merge label Nov 29, 2017
@tmjd
Copy link
Member Author

tmjd commented Nov 29, 2017

I have cherry-picked the change from 0038728 that was made against the master branch so I think this is ready to go.
I also removed the hold-merge label since v2.6.3 has been released so I think this can go into the v1.11.x-series branch now.

Copy link
Member

@caseydavenport caseydavenport left a comment

Choose a reason for hiding this comment

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

Thanks @tmjd! Merge away.

@tmjd tmjd merged commit 24f3f8f into projectcalico:v1.11.x-series Nov 29, 2017
@tmjd tmjd deleted the set-mac-for-v2-6 branch November 29, 2017 16:45
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