dect
/
libnl
Archived
13
0
Fork 0

link: Ignore bridging notifications in link cache manager

RTM_DELLINK and RTM_NEWLINK bridging notifications should not delete/add
entries to a link cache.
This commit is contained in:
Thomas Graf 2011-10-21 11:31:58 +02:00
parent 2bcd8ecd27
commit 7f20c57e37
1 changed files with 14 additions and 0 deletions

View File

@ -528,6 +528,19 @@ errout:
return err;
}
static int link_event_filter(struct nl_cache *cache, struct nl_object *obj)
{
struct rtnl_link *link = (struct rtnl_link *) obj;
/*
* Ignore bridging messages when keeping the cache manager up to date.
*/
if (link->l_family == AF_BRIDGE)
return NL_SKIP;
return NL_OK;
}
static int link_request_update(struct nl_cache *cache, struct nl_sock *sk)
{
int family = cache->c_iarg1;
@ -2186,6 +2199,7 @@ static struct nl_cache_ops rtnl_link_ops = {
.co_groups = link_groups,
.co_request_update = link_request_update,
.co_msg_parser = link_msg_parser,
.co_event_filter = link_event_filter,
.co_obj_ops = &link_obj_ops,
};