File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ type jsonLink struct {
36
36
AllMulticast int `json:"allmulti"`
37
37
Master string `json:"master"`
38
38
Up string `json:"operstate"`
39
+ Type string `json:"link_type"`
39
40
Info struct {
40
41
Kind string `json:"info_kind"`
41
42
} `json:"linkinfo"`
@@ -104,7 +105,7 @@ func LinkFromName(name string) (*Link, error) {
104
105
var links []jsonLink
105
106
err = json .Unmarshal ([]byte (out ), & links )
106
107
if err != nil {
107
- return nil , fmt .Errorf ("failed to decode JSON link representation: %w" , err )
108
+ return nil , fmt .Errorf ("Failed to decode JSON link representation: %w" , err )
108
109
}
109
110
110
111
jl := & links [0 ]
@@ -117,7 +118,7 @@ func LinkFromName(name string) (*Link, error) {
117
118
Master : jl .Master ,
118
119
}
119
120
120
- if jl .Address != "" {
121
+ if jl .Type == "ether" && jl . Address != "" {
121
122
l .Address , err = net .ParseMAC (jl .Address )
122
123
if err != nil {
123
124
return nil , err
You can’t perform that action at this time.
0 commit comments