Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340625
b: refs/heads/master
c: 4197f24
h: refs/heads/master
i:
  340623: 412e92a
v: v3
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Nov 3, 2012
1 parent f617e03 commit 55bb61e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3ba368c43565f31528b3aea585bb4119fded4eb1
refs/heads/master: 4197f24b5bd8be03e84d23920e90f6a1313f4b79
11 changes: 3 additions & 8 deletions trunk/net/bridge/br_sysfs_br.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,23 +298,18 @@ static ssize_t store_group_addr(struct device *d,
const char *buf, size_t len)
{
struct net_bridge *br = to_bridge(d);
unsigned int new_addr[6];
u8 new_addr[6];
int i;

if (!capable(CAP_NET_ADMIN))
return -EPERM;

if (sscanf(buf, "%x:%x:%x:%x:%x:%x",
if (sscanf(buf, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
&new_addr[0], &new_addr[1], &new_addr[2],
&new_addr[3], &new_addr[4], &new_addr[5]) != 6)
return -EINVAL;

/* Must be 01:80:c2:00:00:0X */
for (i = 0; i < 5; i++)
if (new_addr[i] != br_reserved_address[i])
return -EINVAL;

if (new_addr[5] & ~0xf)
if (!is_link_local(new_addr))
return -EINVAL;

if (new_addr[5] == 1 || /* 802.3x Pause address */
Expand Down

0 comments on commit 55bb61e

Please sign in to comment.