summaryrefslogtreecommitdiff
path: root/lib/route
diff options
context:
space:
mode:
authorThomas Graf <tgraf@redhat.com>2011-10-21 11:31:58 +0200
committerThomas Graf <tgraf@redhat.com>2011-10-21 11:31:58 +0200
commit7f20c57e378cf76b68b7bf83613032a75bf832fd (patch)
tree10df17205cd70bcb15a01455643658d1fae8b407 /lib/route
parent2bcd8ecd27a4c3bad006b43926703c0b60158f42 (diff)
downloadlibnl-7f20c57e378cf76b68b7bf83613032a75bf832fd.tar.gz
link: Ignore bridging notifications in link cache manager
RTM_DELLINK and RTM_NEWLINK bridging notifications should not delete/add entries to a link cache.
Diffstat (limited to 'lib/route')
-rw-r--r--lib/route/link.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/route/link.c b/lib/route/link.c
index 00beb08..b252f39 100644
--- a/lib/route/link.c
+++ b/lib/route/link.c
@@ -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,
};