stprov outputs unnecessarily confusing: `malformed mac address: ""`
High-level issue: I ran stprov and it said: malformed mac address: ""
(so it reached here). Somewhat counter-intuitive.
My situation was that the kernel did not have drivers for my NIC. But a sit0
interface was there (CONFIG_IPV6_SIT
), and stprov picked it up and got hold of its empty MAC address.
stprov was run like stprov remote static -H foo -i 192.168.12.42/24 ...
-- that is, without any explicit interface (no -I
). The core cause of the above error message seems to be that function options.DefaultInterfaces
can return (useless) MAC addresses that are the empty string (""
).
Quick fix may be to make that function filter out empty MAC addrs, as the whole point of it is to return MAC addrs, and the function is also called from dhcp.go
. Or this could be done by the callers. But possibly there is a need for an overall investigation into the logic of stprov, and this is just a small part of it all. I could provide a patch for doing the filtering in DefaultInterfaces() though, as that makes sense to me now.