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

Do not assign random MACs to IPVLAN links #29

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/conlink/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,16 @@ General Options:
- Add default values to a link:
- type: veth
- dev: eth0
- mac: random MAC starting with first octet of 'c2'
- mac: random MAC starting with first octet of 'c2' (not added to ipvlan)
- mtu: --default-mtu (for non *vlan type)
- base: :conlink for veth type, :host for *vlan types, :local otherwise"
[{:as link :keys [type bridge ip route forward netem ethtool]} bridges opts]
(let [{:keys [docker-eth0? docker-eth0-address]} @ctx
{:keys [default-mtu keep-veth-offload]} opts
type (keyword (or type "veth"))
dev (get link :dev "eth0")
mac (get link :mac (random-mac))
mac (when-not (= :ipvlan type)
(get link :mac (random-mac)))
base-default (cond (= :veth type) :conlink
(VLAN-TYPES type) :host
:else :local)
Expand All @@ -138,10 +139,11 @@ General Options:
{:type type
:dev dev
:base base
:mac mac
:ethtool ethtool}
(when bridge
{:bridge bridge})
(when mac
{:mac mac})
(when (not (VLAN-TYPES type))
{:mtu (get link :mtu default-mtu)})
(when route
Expand Down