diff options
author | Patrick McHardy <kaber@trash.net> | 2007-07-11 19:42:31 -0700 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-11 19:45:36 -0700 |
commit | 0e06877c6fdbc67b1132be895f995acd1ff30135 (patch) | |
tree | ddaba8cddc8a95d23ee18f812c6aba67dd9b1c6f /net/8021q/vlan_netlink.c | |
parent | 2d85cba2b272a5201a60966a65a4f8c0bcc0bb71 (diff) | |
download | op-kernel-dev-0e06877c6fdbc67b1132be895f995acd1ff30135.zip op-kernel-dev-0e06877c6fdbc67b1132be895f995acd1ff30135.tar.gz |
[RTNETLINK]: rtnl_link: allow specifying initial device address
Drivers need to validate the initial addresses in their netlink attribute
validation function or manually reject them if they can't support this.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q/vlan_netlink.c')
-rw-r--r-- | net/8021q/vlan_netlink.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/8021q/vlan_netlink.c b/net/8021q/vlan_netlink.c index 844c7e4..6cdd1e0 100644 --- a/net/8021q/vlan_netlink.c +++ b/net/8021q/vlan_netlink.c @@ -41,6 +41,13 @@ static int vlan_validate(struct nlattr *tb[], struct nlattr *data[]) u16 id; int err; + if (tb[IFLA_ADDRESS]) { + if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN) + return -EINVAL; + if (!is_valid_ether_addr(nla_data(tb[IFLA_ADDRESS]))) + return -EADDRNOTAVAIL; + } + if (!data) return -EINVAL; |