aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch/vport-internal_dev.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@redhat.com>2012-11-29 14:55:05 -0500
committerJesse Gross <jesse@nicira.com>2012-12-04 12:27:49 -0500
commit9151991c028ccae896388d8b1d2d8a3e3deb2b9a (patch)
treecbb9e003f6faf8ca8669212e604487618e5f9977 /net/openvswitch/vport-internal_dev.c
parenta5a81f0b9025867efb999d14a8dfc1907c5a4c3b (diff)
openvswitch: Use eth_mac_addr() instead of duplicating it
bonus: if we ever are to use IFF_LIVE_ADDR_CHANGE for anything further than to check availability in eth_mac_addr(), Open vSwitch will be ready for that. Signed-off-by: Thomas Graf <tgraf@redhat.com> Signed-off-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'net/openvswitch/vport-internal_dev.c')
-rw-r--r--net/openvswitch/vport-internal_dev.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c
index 5d460c37df07..90816c71c087 100644
--- a/net/openvswitch/vport-internal_dev.c
+++ b/net/openvswitch/vport-internal_dev.c
@@ -63,17 +63,6 @@ static struct rtnl_link_stats64 *internal_dev_get_stats(struct net_device *netde
63 return stats; 63 return stats;
64} 64}
65 65
66static int internal_dev_mac_addr(struct net_device *dev, void *p)
67{
68 struct sockaddr *addr = p;
69
70 if (!is_valid_ether_addr(addr->sa_data))
71 return -EADDRNOTAVAIL;
72 dev->addr_assign_type &= ~NET_ADDR_RANDOM;
73 memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
74 return 0;
75}
76
77/* Called with rcu_read_lock_bh. */ 66/* Called with rcu_read_lock_bh. */
78static int internal_dev_xmit(struct sk_buff *skb, struct net_device *netdev) 67static int internal_dev_xmit(struct sk_buff *skb, struct net_device *netdev)
79{ 68{
@@ -127,7 +116,7 @@ static const struct net_device_ops internal_dev_netdev_ops = {
127 .ndo_open = internal_dev_open, 116 .ndo_open = internal_dev_open,
128 .ndo_stop = internal_dev_stop, 117 .ndo_stop = internal_dev_stop,
129 .ndo_start_xmit = internal_dev_xmit, 118 .ndo_start_xmit = internal_dev_xmit,
130 .ndo_set_mac_address = internal_dev_mac_addr, 119 .ndo_set_mac_address = eth_mac_addr,
131 .ndo_change_mtu = internal_dev_change_mtu, 120 .ndo_change_mtu = internal_dev_change_mtu,
132 .ndo_get_stats64 = internal_dev_get_stats, 121 .ndo_get_stats64 = internal_dev_get_stats,
133}; 122};
@@ -139,6 +128,7 @@ static void do_setup(struct net_device *netdev)
139 netdev->netdev_ops = &internal_dev_netdev_ops; 128 netdev->netdev_ops = &internal_dev_netdev_ops;
140 129
141 netdev->priv_flags &= ~IFF_TX_SKB_SHARING; 130 netdev->priv_flags &= ~IFF_TX_SKB_SHARING;
131 netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
142 netdev->destructor = internal_dev_destructor; 132 netdev->destructor = internal_dev_destructor;
143 SET_ETHTOOL_OPS(netdev, &internal_dev_ethtool_ops); 133 SET_ETHTOOL_OPS(netdev, &internal_dev_ethtool_ops);
144 netdev->tx_queue_len = 0; 134 netdev->tx_queue_len = 0;