ChangeSet 1.2181.54.2, 2005/04/01 14:24:14+02:00, [EMAIL PROTECTED]

        [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 <[EMAIL PROTECTED]>
        Signed-off-by: David S. Miller <[EMAIL PROTECTED]> 



 include/net/gen_stats.h |    3 ++-
 net/core/gen_stats.c    |   11 +++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)


diff -Nru a/include/net/gen_stats.h b/include/net/gen_stats.h
--- a/include/net/gen_stats.h   2005-04-04 08:11:46 -07:00
+++ b/include/net/gen_stats.h   2005-04-04 08:11:46 -07:00
@@ -15,7 +15,8 @@
        /* Backward compatability */
        int               compat_tc_stats;
        int               compat_xstats;
-       struct rtattr *   xstats;
+       void *            xstats;
+       int               xstats_len;
        struct tc_stats   tc_stats;
 };
 
diff -Nru a/net/core/gen_stats.c b/net/core/gen_stats.c
--- a/net/core/gen_stats.c      2005-04-04 08:11:46 -07:00
+++ b/net/core/gen_stats.c      2005-04-04 08:11:46 -07:00
@@ -177,8 +177,11 @@
 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 @@
                        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;
        }
 
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to