Skip to content
/ incus Public
forked from lxc/incus

Commit cb1db1f

Browse files
committed
incusd/ip: Only parse MAC on ethernet links
Closes lxc#1741 Signed-off-by: Stéphane Graber <[email protected]>
1 parent 186dc6e commit cb1db1f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/server/ip/link.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ type jsonLink struct {
3636
AllMulticast int `json:"allmulti"`
3737
Master string `json:"master"`
3838
Up string `json:"operstate"`
39+
Type string `json:"link_type"`
3940
Info struct {
4041
Kind string `json:"info_kind"`
4142
} `json:"linkinfo"`
@@ -117,7 +118,7 @@ func LinkFromName(name string) (*Link, error) {
117118
Master: jl.Master,
118119
}
119120

120-
if jl.Address != "" {
121+
if jl.Type == "ether" && jl.Address != "" {
121122
l.Address, err = net.ParseMAC(jl.Address)
122123
if err != nil {
123124
return nil, err

0 commit comments

Comments
 (0)