diff options
author | Cong Wang <xiyou.wangcong@gmail.com> | 2014-07-12 00:19:03 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-07-16 08:59:25 (GMT) |
commit | c4d700038b93a961711169c954e5e0877abea1d0 (patch) | |
tree | cf9b5f5e80a8fdf8ac43bd93bfc566df1f43050c | |
parent | 94e134587394c5fa6a6159a7c35bd89a7047f822 (diff) | |
download | libnl-c4d700038b93a961711169c954e5e0877abea1d0.zip libnl-c4d700038b93a961711169c954e5e0877abea1d0.tar.gz libnl-c4d700038b93a961711169c954e5e0877abea1d0.tar.bz2 |
tc: add co_groups for tc qdisc and filter
Otherwise these tc caches would not be able to be updated
asynchronously.
Cc: Thomas Haller <thaller@redhat.com>
Cc: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r-- | include/netlink-private/tc.h | 2 | ||||
-rw-r--r-- | lib/route/class.c | 1 | ||||
-rw-r--r-- | lib/route/cls.c | 1 | ||||
-rw-r--r-- | lib/route/qdisc.c | 1 | ||||
-rw-r--r-- | lib/route/tc.c | 6 |
5 files changed, 11 insertions, 0 deletions
diff --git a/include/netlink-private/tc.h b/include/netlink-private/tc.h index 182adaa..d0cb283 100644 --- a/include/netlink-private/tc.h +++ b/include/netlink-private/tc.h @@ -48,6 +48,8 @@ static inline void *tca_xstats(struct rtnl_tc *tca) return tca->tc_xstats->d_data; } +extern struct nl_af_group tc_groups[]; + #ifdef __cplusplus } #endif diff --git a/lib/route/class.c b/lib/route/class.c index 050f42a..56ad1d8 100644 --- a/lib/route/class.c +++ b/lib/route/class.c @@ -453,6 +453,7 @@ static struct nl_cache_ops rtnl_class_ops = { END_OF_MSGTYPES_LIST, }, .co_protocol = NETLINK_ROUTE, + .co_groups = tc_groups, .co_request_update = &class_request_update, .co_msg_parser = &class_msg_parser, .co_obj_ops = &class_obj_ops, diff --git a/lib/route/cls.c b/lib/route/cls.c index b7860c3..649a7d0 100644 --- a/lib/route/cls.c +++ b/lib/route/cls.c @@ -411,6 +411,7 @@ static struct nl_cache_ops rtnl_cls_ops = { END_OF_MSGTYPES_LIST, }, .co_protocol = NETLINK_ROUTE, + .co_groups = tc_groups, .co_request_update = cls_request_update, .co_msg_parser = cls_msg_parser, .co_obj_ops = &cls_obj_ops, diff --git a/lib/route/qdisc.c b/lib/route/qdisc.c index 250d191..b8b6fa5 100644 --- a/lib/route/qdisc.c +++ b/lib/route/qdisc.c @@ -541,6 +541,7 @@ static struct nl_cache_ops rtnl_qdisc_ops = { END_OF_MSGTYPES_LIST, }, .co_protocol = NETLINK_ROUTE, + .co_groups = tc_groups, .co_request_update = qdisc_request_update, .co_msg_parser = qdisc_msg_parser, .co_obj_ops = &qdisc_obj_ops, diff --git a/lib/route/tc.c b/lib/route/tc.c index 0886e8e..0f150cc 100644 --- a/lib/route/tc.c +++ b/lib/route/tc.c @@ -1056,6 +1056,12 @@ void *rtnl_tc_data_check(struct rtnl_tc *tc, struct rtnl_tc_ops *ops) return rtnl_tc_data(tc); } +struct nl_af_group tc_groups[] = { + { AF_UNSPEC, RTNLGRP_TC }, + { END_OF_GROUP_LIST }, +}; + + void rtnl_tc_type_register(struct rtnl_tc_type_ops *ops) { if (ops->tt_type > RTNL_TC_TYPE_MAX) |