Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 266405
b: refs/heads/master
c: 64af1ba
h: refs/heads/master
i:
  266403: fc6b91b
v: v3
  • Loading branch information
stephen hemminger authored and David S. Miller committed Oct 3, 2011
1 parent 7741aeb commit 507e23d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 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: 77f9859837cbe262ef2aa12fc38d18458814c2ca
refs/heads/master: 64af1bac9b979ae1f2f052742fda06d65f497643
23 changes: 16 additions & 7 deletions trunk/net/bridge/br_fdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,19 +558,28 @@ int br_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb)

/* Create new static fdb entry */
static int fdb_add_entry(struct net_bridge_port *source, const __u8 *addr,
__u16 state)
__u16 state, __u16 flags)
{
struct net_bridge *br = source->br;
struct hlist_head *head = &br->hash[br_mac_hash(addr)];
struct net_bridge_fdb_entry *fdb;

fdb = fdb_find(head, addr);
if (fdb)
return -EEXIST;
if (fdb == NULL) {
if (!(flags & NLM_F_CREATE))
return -ENOENT;

fdb = fdb_create(head, source, addr);
if (!fdb)
return -ENOMEM;
fdb = fdb_create(head, source, addr);
if (!fdb)
return -ENOMEM;
} else {
if (flags & NLM_F_EXCL)
return -EEXIST;

if (flags & NLM_F_REPLACE)
fdb->updated = fdb->used = jiffies;
fdb->is_local = fdb->is_static = 0;
}

if (state & NUD_PERMANENT)
fdb->is_local = fdb->is_static = 1;
Expand Down Expand Up @@ -626,7 +635,7 @@ int br_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
}

spin_lock_bh(&p->br->hash_lock);
err = fdb_add_entry(p, addr, ndm->ndm_state);
err = fdb_add_entry(p, addr, ndm->ndm_state, nlh->nlmsg_flags);
spin_unlock_bh(&p->br->hash_lock);

return err;
Expand Down

0 comments on commit 507e23d

Please sign in to comment.