]> granicus.if.org Git - libnl/commitdiff
lib: route: rule: add rule_groups to cache ops
authorRoopa Prabhu <roopa@cumulusnetworks.com>
Wed, 14 Feb 2018 22:29:09 +0000 (14:29 -0800)
committerThomas Haller <thaller@redhat.com>
Thu, 15 Feb 2018 09:21:33 +0000 (10:21 +0100)
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Acked-by: David Ahern <dsa@cumulusnetworks.com>
lib/route/rule.c

index e257349412ecb5692bad2f9a51d02bb67767f9d2..ff5ba09d4abcffff545afe6ef0c2938052217453 100644 (file)
@@ -783,6 +783,12 @@ static struct nl_object_ops rule_obj_ops = {
        .oo_id_attrs            = ~0,
 };
 
+static struct nl_af_group rule_groups[] = {
+       { AF_INET,      RTNLGRP_IPV4_RULE },
+       { AF_INET6,     RTNLGRP_IPV6_RULE },
+       { END_OF_GROUP_LIST },
+};
+
 static struct nl_cache_ops rtnl_rule_ops = {
        .co_name                = "route/rule",
        .co_hdrsize             = sizeof(struct fib_rule_hdr),
@@ -796,6 +802,7 @@ static struct nl_cache_ops rtnl_rule_ops = {
        .co_request_update      = rule_request_update,
        .co_msg_parser          = rule_msg_parser,
        .co_obj_ops             = &rule_obj_ops,
+       .co_groups              = rule_groups,
 };
 
 static void __init rule_init(void)