ChangeSet 1.2181.38.2, 2005/03/29 02:55:11+02:00, [EMAIL PROTECTED]
[NET]: Make primary TLV type optional
Allows the use of the gnet_stats API for backward compatiblity
cases where no "modern" TLV structure is needed.
Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
gen_stats.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff -Nru a/net/core/gen_stats.c b/net/core/gen_stats.c
--- a/net/core/gen_stats.c 2005-03-30 20:05:59 -08:00
+++ b/net/core/gen_stats.c 2005-03-30 20:05:59 -08:00
@@ -26,7 +26,9 @@
static inline int
gnet_stats_copy(struct gnet_dump *d, int type, void *buf, int size)
{
- RTA_PUT(d->skb, type, size, buf);
+ if (type)
+ RTA_PUT(d->skb, type, size, buf);
+
return 0;
rtattr_failure:
@@ -58,7 +60,8 @@
{
spin_lock_bh(lock);
d->lock = lock;
- d->tail = (struct rtattr *) skb->tail;
+ if (type)
+ d->tail = (struct rtattr *) skb->tail;
d->skb = skb;
d->compat_tc_stats = tc_stats_type;
d->compat_xstats = xstats_type;
@@ -194,7 +197,8 @@
int
gnet_stats_finish_copy(struct gnet_dump *d)
{
- d->tail->rta_len = d->skb->tail - (u8 *) d->tail;
+ if (d->tail)
+ d->tail->rta_len = d->skb->tail - (u8 *) d->tail;
if (d->compat_tc_stats)
if (gnet_stats_copy(d, d->compat_tc_stats, &d->tc_stats,
-
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