On Thu, Jul 20, 2017 at 11:27 AM, Cong Wang <xiyou.wangc...@gmail.com> wrote: > dev_set_mac_address() accepts a struct sockaddr pointer as > input but we have various types of mac addresse whose lengths > are up to MAX_ADDR_LEN, this is confusing. > > Make it void like ->ndo_set_mac_address() and let callers check > its length before calling it. It is too late to fix dev_ifsioc() > due to API compatibility, so just reject those larger than > sizeof(struct sockaddr). > > Fortunately, only a few IPv6 tunnel devices have addr_len > larger than sizeof(struct sockaddr) and they don't support > ndo_set_mac_addr(). But team driver seems still buggy without > this patch.
Note, in team lb mode, I can successfully enslave ip6gre device to a team device and make its mac addr look like: # ip li show dev team0 17: team0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1448 qdisc noqueue state UP mode DEFAULT group default qlen 1000 link/gre6 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 brd 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 But ifconfig seems not recognize gre6 family, so it is just a matter of a few lines of C code to trigger the bug.