diff options
author | Thomas Graf <tgraf@suug.ch> | 2005-04-01 18:24:14 +0200 |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2005-04-01 18:24:14 +0200 |
commit | 80458f046daa6dd6f9a0f8cd2b6a5d3ac766cd28 (patch) | |
tree | d656d1bc54fe784d9e6d79e7d753de91d268caf7 | |
parent | 99665d91829d412c2d4103e0a0034af7f740a02c (diff) | |
download | history-80458f046daa6dd6f9a0f8cd2b6a5d3ac766cd28.tar.gz |
[NET]: Allow dumping of application specific statistics if no primary TLV is used
Although this case is hypothetical at the moment, more advanced actions are
likely to need this in the future.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/gen_stats.h | 3 | ||||
-rw-r--r-- | net/core/gen_stats.c | 11 |
2 files changed, 9 insertions, 5 deletions
diff --git a/include/net/gen_stats.h b/include/net/gen_stats.h index 9a9bea508d1beb..0b95cf031d6e0f 100644 --- a/include/net/gen_stats.h +++ b/include/net/gen_stats.h @@ -15,7 +15,8 @@ struct gnet_dump /* Backward compatability */ int compat_tc_stats; int compat_xstats; - struct rtattr * xstats; + void * xstats; + int xstats_len; struct tc_stats tc_stats; }; diff --git a/net/core/gen_stats.c b/net/core/gen_stats.c index ebb86fbd23ab65..92eaceb064d81e 100644 --- a/net/core/gen_stats.c +++ b/net/core/gen_stats.c @@ -177,8 +177,11 @@ gnet_stats_copy_queue(struct gnet_dump *d, struct gnet_stats_queue *q) int gnet_stats_copy_app(struct gnet_dump *d, void *st, int len) { - if (d->compat_xstats) - d->xstats = (struct rtattr *) d->skb->tail; + if (d->compat_xstats) { + d->xstats = st; + d->xstats_len = len; + } + return gnet_stats_copy(d, TCA_STATS_APP, st, len); } @@ -206,8 +209,8 @@ gnet_stats_finish_copy(struct gnet_dump *d) return -1; if (d->compat_xstats && d->xstats) { - if (gnet_stats_copy(d, d->compat_xstats, RTA_DATA(d->xstats), - RTA_PAYLOAD(d->xstats)) < 0) + if (gnet_stats_copy(d, d->compat_xstats, d->xstats, + d->xstats_len) < 0) return -1; } |