net: use eth_hw_addr_random() and reset addr_assign_type
[deliverable/linux.git] / drivers / net / macvlan.c
index f2f820c4b40a4fd8c3384905fb30b35dbe7c61fc..f975afdc315ce507b5a5b80c04325a224849c320 100644 (file)
@@ -173,6 +173,7 @@ static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb)
                skb = ip_check_defrag(skb, IP_DEFRAG_MACVLAN);
                if (!skb)
                        return RX_HANDLER_CONSUMED;
+               eth = eth_hdr(skb);
                src = macvlan_hash_lookup(port, eth->h_source);
                if (!src)
                        /* frame comes from an external address */
@@ -371,6 +372,7 @@ static int macvlan_set_mac_address(struct net_device *dev, void *p)
 
        if (!(dev->flags & IFF_UP)) {
                /* Just copy in the new address */
+               dev->addr_assign_type &= ~NET_ADDR_RANDOM;
                memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
        } else {
                /* Rehash and update the device filters */
@@ -686,7 +688,7 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
                return -EINVAL;
 
        if (!tb[IFLA_ADDRESS])
-               random_ether_addr(dev->dev_addr);
+               eth_hw_addr_random(dev);
 
        if (!macvlan_port_exists(lowerdev)) {
                err = macvlan_port_create(lowerdev);
This page took 0.035337 seconds and 5 git commands to generate.