aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dummy.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/dummy.c')
-rw-r--r--drivers/net/dummy.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index 373ff700404f..756a6bcb038d 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -84,9 +84,21 @@ static int dummy_xmit(struct sk_buff *skb, struct net_device *dev)
84 return 0; 84 return 0;
85} 85}
86 86
87static int dummy_validate(struct nlattr *tb[], struct nlattr *data[])
88{
89 if (tb[IFLA_ADDRESS]) {
90 if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
91 return -EINVAL;
92 if (!is_valid_ether_addr(nla_data(tb[IFLA_ADDRESS])))
93 return -EADDRNOTAVAIL;
94 }
95 return 0;
96}
97
87static struct rtnl_link_ops dummy_link_ops __read_mostly = { 98static struct rtnl_link_ops dummy_link_ops __read_mostly = {
88 .kind = "dummy", 99 .kind = "dummy",
89 .setup = dummy_setup, 100 .setup = dummy_setup,
101 .validate = dummy_validate,
90}; 102};
91 103
92/* Number of dummy devices to be set up by this module. */ 104/* Number of dummy devices to be set up by this module. */