sched: align nlattr properly when needed
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Tue, 26 Apr 2016 08:06:18 +0000 (10:06 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Apr 2016 16:00:49 +0000 (12:00 -0400)
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
33 files changed:
Documentation/networking/gen_stats.txt
include/net/gen_stats.h
include/uapi/linux/gen_stats.h
include/uapi/linux/pkt_cls.h
include/uapi/linux/rtnetlink.h
include/uapi/linux/tc_act/tc_bpf.h
include/uapi/linux/tc_act/tc_connmark.h
include/uapi/linux/tc_act/tc_csum.h
include/uapi/linux/tc_act/tc_defact.h
include/uapi/linux/tc_act/tc_gact.h
include/uapi/linux/tc_act/tc_ife.h
include/uapi/linux/tc_act/tc_ipt.h
include/uapi/linux/tc_act/tc_mirred.h
include/uapi/linux/tc_act/tc_nat.h
include/uapi/linux/tc_act/tc_pedit.h
include/uapi/linux/tc_act/tc_skbedit.h
include/uapi/linux/tc_act/tc_vlan.h
net/core/gen_stats.c
net/sched/act_api.c
net/sched/act_bpf.c
net/sched/act_connmark.c
net/sched/act_csum.c
net/sched/act_gact.c
net/sched/act_ife.c
net/sched/act_ipt.c
net/sched/act_mirred.c
net/sched/act_nat.c
net/sched/act_pedit.c
net/sched/act_simple.c
net/sched/act_skbedit.c
net/sched/act_vlan.c
net/sched/cls_u32.c
net/sched/sch_api.c

index 70e6275b757a46c786cd1e48f3532317a6c15b65..ff630a87b511c2e1e9f13918ab3d014442fb3af6 100644 (file)
@@ -33,7 +33,8 @@ my_dumping_routine(struct sk_buff *skb, ...)
 {
        struct gnet_dump dump;
 
-       if (gnet_stats_start_copy(skb, TCA_STATS2, &mystruct->lock, &dump) < 0)
+       if (gnet_stats_start_copy(skb, TCA_STATS2, &mystruct->lock, &dump,
+                                 TCA_PAD) < 0)
                goto rtattr_failure;
 
        if (gnet_stats_copy_basic(&dump, &mystruct->bstats) < 0 ||
@@ -56,7 +57,8 @@ existing TLV types.
 my_dumping_routine(struct sk_buff *skb, ...)
 {
     if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS,
-               TCA_XSTATS, &mystruct->lock, &dump) < 0)
+                                    TCA_XSTATS, &mystruct->lock, &dump,
+                                    TCA_PAD) < 0)
                goto rtattr_failure;
        ...
 }
index cbafa3768d48d1e1cae3e068e86f9f0a01813c9e..610cd397890e9cd24f15966b2b20ed39e6e19859 100644 (file)
@@ -19,17 +19,19 @@ struct gnet_dump {
        /* Backward compatibility */
        int               compat_tc_stats;
        int               compat_xstats;
+       int               padattr;
        void *            xstats;
        int               xstats_len;
        struct tc_stats   tc_stats;
 };
 
 int gnet_stats_start_copy(struct sk_buff *skb, int type, spinlock_t *lock,
-                         struct gnet_dump *d);
+                         struct gnet_dump *d, int padattr);
 
 int gnet_stats_start_copy_compat(struct sk_buff *skb, int type,
                                 int tc_stats_type, int xstats_type,
-                                spinlock_t *lock, struct gnet_dump *d);
+                                spinlock_t *lock, struct gnet_dump *d,
+                                int padattr);
 
 int gnet_stats_copy_basic(struct gnet_dump *d,
                          struct gnet_stats_basic_cpu __percpu *cpu,
index 6487317ea619c41d4ea662f1162417fa6c6e947f..52deccc2128eeb955b412aeef5bdb0ed8098d5f8 100644 (file)
@@ -10,6 +10,7 @@ enum {
        TCA_STATS_QUEUE,
        TCA_STATS_APP,
        TCA_STATS_RATE_EST64,
+       TCA_STATS_PAD,
        __TCA_STATS_MAX,
 };
 #define TCA_STATS_MAX (__TCA_STATS_MAX - 1)
index c43c5f78b9c457e9e0d1addc02668b0b65e42a9e..84660905fedf92c0448c218ccf90ee768cb8d5e3 100644 (file)
@@ -66,6 +66,7 @@ enum {
        TCA_ACT_OPTIONS,
        TCA_ACT_INDEX,
        TCA_ACT_STATS,
+       TCA_ACT_PAD,
        __TCA_ACT_MAX
 };
 
@@ -173,6 +174,7 @@ enum {
        TCA_U32_PCNT,
        TCA_U32_MARK,
        TCA_U32_FLAGS,
+       TCA_U32_PAD,
        __TCA_U32_MAX
 };
 
index a94e0b69c7696fceed97484d119eae5ac7f965e9..262f0379d83ac1965d8f792b5f1d3b8634f86d69 100644 (file)
@@ -542,6 +542,7 @@ enum {
        TCA_FCNT,
        TCA_STATS2,
        TCA_STAB,
+       TCA_PAD,
        __TCA_MAX
 };
 
index 07f17cc70bb3ee2f8ca7667221679b67f09c3cc6..063d9d465119b2519f87aa4e31961311acf026e0 100644 (file)
@@ -26,6 +26,7 @@ enum {
        TCA_ACT_BPF_OPS,
        TCA_ACT_BPF_FD,
        TCA_ACT_BPF_NAME,
+       TCA_ACT_BPF_PAD,
        __TCA_ACT_BPF_MAX,
 };
 #define TCA_ACT_BPF_MAX (__TCA_ACT_BPF_MAX - 1)
index 994b0971bce2102433b4675270dd77a69fbb5bb6..62a5e944c55485270820d36187adb6cb4d5c5b28 100644 (file)
@@ -15,6 +15,7 @@ enum {
        TCA_CONNMARK_UNSPEC,
        TCA_CONNMARK_PARMS,
        TCA_CONNMARK_TM,
+       TCA_CONNMARK_PAD,
        __TCA_CONNMARK_MAX
 };
 #define TCA_CONNMARK_MAX (__TCA_CONNMARK_MAX - 1)
index a047c49a31531e0df45d29943216689795746584..8ac8041ab5f134b74391f5470cef16f3f435ed1c 100644 (file)
@@ -10,6 +10,7 @@ enum {
        TCA_CSUM_UNSPEC,
        TCA_CSUM_PARMS,
        TCA_CSUM_TM,
+       TCA_CSUM_PAD,
        __TCA_CSUM_MAX
 };
 #define TCA_CSUM_MAX (__TCA_CSUM_MAX - 1)
index 17dddb40f74043e40ac09e36e15c925c5aa13df0..d2a3abb77aebdef99a9166e60b95a982f06a74f4 100644 (file)
@@ -12,6 +12,7 @@ enum {
        TCA_DEF_TM,
        TCA_DEF_PARMS,
        TCA_DEF_DATA,
+       TCA_DEF_PAD,
        __TCA_DEF_MAX
 };
 #define TCA_DEF_MAX (__TCA_DEF_MAX - 1)
index f7bf94eed510d47dec8355939b9fc41f5ee625f6..70b536a8f8b260746faecdb14ffa322f0db5ad1c 100644 (file)
@@ -25,6 +25,7 @@ enum {
        TCA_GACT_TM,
        TCA_GACT_PARMS,
        TCA_GACT_PROB,
+       TCA_GACT_PAD,
        __TCA_GACT_MAX
 };
 #define TCA_GACT_MAX (__TCA_GACT_MAX - 1)
index d648ff66586f255c055d7c45d303d96fea8bb839..4ece02a77b9aa567ca02f859735c815f064bb63f 100644 (file)
@@ -23,6 +23,7 @@ enum {
        TCA_IFE_SMAC,
        TCA_IFE_TYPE,
        TCA_IFE_METALST,
+       TCA_IFE_PAD,
        __TCA_IFE_MAX
 };
 #define TCA_IFE_MAX (__TCA_IFE_MAX - 1)
index 130aaadf6fac9bf419c6ff13c7adae05c34f9b4c..7c6e155dd981d17a9fade88994eb82331a4309a8 100644 (file)
@@ -14,6 +14,7 @@ enum {
        TCA_IPT_CNT,
        TCA_IPT_TM,
        TCA_IPT_TARG,
+       TCA_IPT_PAD,
        __TCA_IPT_MAX
 };
 #define TCA_IPT_MAX (__TCA_IPT_MAX - 1)
index 7561750e8fd69b92e1e1a4929e25ec8709d74ce2..3d7a2b352a62c3dfeb0f077c6207a93d8834481d 100644 (file)
@@ -20,6 +20,7 @@ enum {
        TCA_MIRRED_UNSPEC,
        TCA_MIRRED_TM,
        TCA_MIRRED_PARMS,
+       TCA_MIRRED_PAD,
        __TCA_MIRRED_MAX
 };
 #define TCA_MIRRED_MAX (__TCA_MIRRED_MAX - 1)
index 6663aeba0b9a78fd1c76816c8540fdfa4d0ee747..923457c9ebf0caf761bc24c897ba8a20f38e8c22 100644 (file)
@@ -10,6 +10,7 @@ enum {
        TCA_NAT_UNSPEC,
        TCA_NAT_PARMS,
        TCA_NAT_TM,
+       TCA_NAT_PAD,
        __TCA_NAT_MAX
 };
 #define TCA_NAT_MAX (__TCA_NAT_MAX - 1)
index 716cfabcd5b2fa6064588b118b7721f29477bf30..6389959a5157cf1f43338a3742093f66b14b564e 100644 (file)
@@ -10,6 +10,7 @@ enum {
        TCA_PEDIT_UNSPEC,
        TCA_PEDIT_TM,
        TCA_PEDIT_PARMS,
+       TCA_PEDIT_PAD,
        __TCA_PEDIT_MAX
 };
 #define TCA_PEDIT_MAX (__TCA_PEDIT_MAX - 1)
index 7a2e910a5f0836e0ab92db331acef7780fb2029e..fecb5cc48c40667a5b75d7c06158d91443a11862 100644 (file)
@@ -39,6 +39,7 @@ enum {
        TCA_SKBEDIT_PRIORITY,
        TCA_SKBEDIT_QUEUE_MAPPING,
        TCA_SKBEDIT_MARK,
+       TCA_SKBEDIT_PAD,
        __TCA_SKBEDIT_MAX
 };
 #define TCA_SKBEDIT_MAX (__TCA_SKBEDIT_MAX - 1)
index f7b8d448b9603f9b1154472911f5a4b8ba663a54..31151ff6264f5ca966691c4ad0008c6b09cfe71a 100644 (file)
@@ -28,6 +28,7 @@ enum {
        TCA_VLAN_PARMS,
        TCA_VLAN_PUSH_VLAN_ID,
        TCA_VLAN_PUSH_VLAN_PROTOCOL,
+       TCA_VLAN_PAD,
        __TCA_VLAN_MAX,
 };
 #define TCA_VLAN_MAX (__TCA_VLAN_MAX - 1)
index e640462ea8bf55bdd1645bbe9a68f459c2afe271..f96ee8b9478d8a752e78e1ca39c2351f5863f054 100644 (file)
@@ -25,9 +25,9 @@
 
 
 static inline int
-gnet_stats_copy(struct gnet_dump *d, int type, void *buf, int size)
+gnet_stats_copy(struct gnet_dump *d, int type, void *buf, int size, int padattr)
 {
-       if (nla_put(d->skb, type, size, buf))
+       if (nla_put_64bit(d->skb, type, size, buf, padattr))
                goto nla_put_failure;
        return 0;
 
@@ -59,7 +59,8 @@ nla_put_failure:
  */
 int
 gnet_stats_start_copy_compat(struct sk_buff *skb, int type, int tc_stats_type,
-       int xstats_type, spinlock_t *lock, struct gnet_dump *d)
+                            int xstats_type, spinlock_t *lock,
+                            struct gnet_dump *d, int padattr)
        __acquires(lock)
 {
        memset(d, 0, sizeof(*d));
@@ -71,16 +72,17 @@ gnet_stats_start_copy_compat(struct sk_buff *skb, int type, int tc_stats_type,
        d->skb = skb;
        d->compat_tc_stats = tc_stats_type;
        d->compat_xstats = xstats_type;
+       d->padattr = padattr;
 
        if (d->tail)
-               return gnet_stats_copy(d, type, NULL, 0);
+               return gnet_stats_copy(d, type, NULL, 0, padattr);
 
        return 0;
 }
 EXPORT_SYMBOL(gnet_stats_start_copy_compat);
 
 /**
- * gnet_stats_start_copy_compat - start dumping procedure in compatibility mode
+ * gnet_stats_start_copy - start dumping procedure in compatibility mode
  * @skb: socket buffer to put statistics TLVs into
  * @type: TLV type for top level statistic TLV
  * @lock: statistics lock
@@ -94,9 +96,9 @@ EXPORT_SYMBOL(gnet_stats_start_copy_compat);
  */
 int
 gnet_stats_start_copy(struct sk_buff *skb, int type, spinlock_t *lock,
-       struct gnet_dump *d)
+                     struct gnet_dump *d, int padattr)
 {
-       return gnet_stats_start_copy_compat(skb, type, 0, 0, lock, d);
+       return gnet_stats_start_copy_compat(skb, type, 0, 0, lock, d, padattr);
 }
 EXPORT_SYMBOL(gnet_stats_start_copy);
 
@@ -169,7 +171,8 @@ gnet_stats_copy_basic(struct gnet_dump *d,
                memset(&sb, 0, sizeof(sb));
                sb.bytes = bstats.bytes;
                sb.packets = bstats.packets;
-               return gnet_stats_copy(d, TCA_STATS_BASIC, &sb, sizeof(sb));
+               return gnet_stats_copy(d, TCA_STATS_BASIC, &sb, sizeof(sb),
+                                      TCA_STATS_PAD);
        }
        return 0;
 }
@@ -208,11 +211,13 @@ gnet_stats_copy_rate_est(struct gnet_dump *d,
        }
 
        if (d->tail) {
-               res = gnet_stats_copy(d, TCA_STATS_RATE_EST, &est, sizeof(est));
+               res = gnet_stats_copy(d, TCA_STATS_RATE_EST, &est, sizeof(est),
+                                     TCA_STATS_PAD);
                if (res < 0 || est.bps == r->bps)
                        return res;
                /* emit 64bit stats only if needed */
-               return gnet_stats_copy(d, TCA_STATS_RATE_EST64, r, sizeof(*r));
+               return gnet_stats_copy(d, TCA_STATS_RATE_EST64, r, sizeof(*r),
+                                      TCA_STATS_PAD);
        }
 
        return 0;
@@ -286,7 +291,8 @@ gnet_stats_copy_queue(struct gnet_dump *d,
 
        if (d->tail)
                return gnet_stats_copy(d, TCA_STATS_QUEUE,
-                                      &qstats, sizeof(qstats));
+                                      &qstats, sizeof(qstats),
+                                      TCA_STATS_PAD);
 
        return 0;
 }
@@ -316,7 +322,8 @@ gnet_stats_copy_app(struct gnet_dump *d, void *st, int len)
        }
 
        if (d->tail)
-               return gnet_stats_copy(d, TCA_STATS_APP, st, len);
+               return gnet_stats_copy(d, TCA_STATS_APP, st, len,
+                                      TCA_STATS_PAD);
 
        return 0;
 
@@ -347,12 +354,12 @@ gnet_stats_finish_copy(struct gnet_dump *d)
 
        if (d->compat_tc_stats)
                if (gnet_stats_copy(d, d->compat_tc_stats, &d->tc_stats,
-                       sizeof(d->tc_stats)) < 0)
+                                   sizeof(d->tc_stats), d->padattr) < 0)
                        return -1;
 
        if (d->compat_xstats && d->xstats) {
                if (gnet_stats_copy(d, d->compat_xstats, d->xstats,
-                       d->xstats_len) < 0)
+                                   d->xstats_len, d->padattr) < 0)
                        return -1;
        }
 
index 96066665e3765d342fd1685ab32f0019c7455564..336774a535c3959f4f25b05d1732c014d0d1763c 100644 (file)
@@ -657,12 +657,15 @@ int tcf_action_copy_stats(struct sk_buff *skb, struct tc_action *a,
        if (compat_mode) {
                if (a->type == TCA_OLD_COMPAT)
                        err = gnet_stats_start_copy_compat(skb, 0,
-                               TCA_STATS, TCA_XSTATS, &p->tcfc_lock, &d);
+                                                          TCA_STATS,
+                                                          TCA_XSTATS,
+                                                          &p->tcfc_lock, &d,
+                                                          TCA_PAD);
                else
                        return 0;
        } else
                err = gnet_stats_start_copy(skb, TCA_ACT_STATS,
-                                           &p->tcfc_lock, &d);
+                                           &p->tcfc_lock, &d, TCA_ACT_PAD);
 
        if (err < 0)
                goto errout;
index 8c9f1f0459ab773139112c453fd1540af3a1b94f..4fd703362563e99eba8a6a60aceb0c9bcccb5a74 100644 (file)
@@ -156,7 +156,8 @@ static int tcf_bpf_dump(struct sk_buff *skb, struct tc_action *act,
        tm.lastuse = jiffies_to_clock_t(jiffies - prog->tcf_tm.lastuse);
        tm.expires = jiffies_to_clock_t(prog->tcf_tm.expires);
 
-       if (nla_put(skb, TCA_ACT_BPF_TM, sizeof(tm), &tm))
+       if (nla_put_64bit(skb, TCA_ACT_BPF_TM, sizeof(tm), &tm,
+                         TCA_ACT_BPF_PAD))
                goto nla_put_failure;
 
        return skb->len;
index c0ed93ce23910f8da64622f5f2df3eea867ee786..2ba700c765e047f3781708c8789ee63dfcc1a37e 100644 (file)
@@ -163,7 +163,8 @@ static inline int tcf_connmark_dump(struct sk_buff *skb, struct tc_action *a,
        t.install = jiffies_to_clock_t(jiffies - ci->tcf_tm.install);
        t.lastuse = jiffies_to_clock_t(jiffies - ci->tcf_tm.lastuse);
        t.expires = jiffies_to_clock_t(ci->tcf_tm.expires);
-       if (nla_put(skb, TCA_CONNMARK_TM, sizeof(t), &t))
+       if (nla_put_64bit(skb, TCA_CONNMARK_TM, sizeof(t), &t,
+                         TCA_CONNMARK_PAD))
                goto nla_put_failure;
 
        return skb->len;
index d22426cdebc08b95357d3e7f38b237d5cd60915f..28e934ed038a6f652d9aaa1b7d82dffd642d73a7 100644 (file)
@@ -549,7 +549,7 @@ static int tcf_csum_dump(struct sk_buff *skb,
        t.install = jiffies_to_clock_t(jiffies - p->tcf_tm.install);
        t.lastuse = jiffies_to_clock_t(jiffies - p->tcf_tm.lastuse);
        t.expires = jiffies_to_clock_t(p->tcf_tm.expires);
-       if (nla_put(skb, TCA_CSUM_TM, sizeof(t), &t))
+       if (nla_put_64bit(skb, TCA_CSUM_TM, sizeof(t), &t, TCA_CSUM_PAD))
                goto nla_put_failure;
 
        return skb->len;
index 887fc1f209ff6355ed4c83254a0ea56666942157..1a6e09fbb2a590f99f08cf4a5ebecba5ec4f996f 100644 (file)
@@ -177,7 +177,7 @@ static int tcf_gact_dump(struct sk_buff *skb, struct tc_action *a, int bind, int
        t.install = jiffies_to_clock_t(jiffies - gact->tcf_tm.install);
        t.lastuse = jiffies_to_clock_t(jiffies - gact->tcf_tm.lastuse);
        t.expires = jiffies_to_clock_t(gact->tcf_tm.expires);
-       if (nla_put(skb, TCA_GACT_TM, sizeof(t), &t))
+       if (nla_put_64bit(skb, TCA_GACT_TM, sizeof(t), &t, TCA_GACT_PAD))
                goto nla_put_failure;
        return skb->len;
 
index c589a9ba506af8ba1376f48162ec8224281a48a0..556f44c9c454b2519971671943d6aa3540132e41 100644 (file)
@@ -550,7 +550,7 @@ static int tcf_ife_dump(struct sk_buff *skb, struct tc_action *a, int bind,
        t.install = jiffies_to_clock_t(jiffies - ife->tcf_tm.install);
        t.lastuse = jiffies_to_clock_t(jiffies - ife->tcf_tm.lastuse);
        t.expires = jiffies_to_clock_t(ife->tcf_tm.expires);
-       if (nla_put(skb, TCA_IFE_TM, sizeof(t), &t))
+       if (nla_put_64bit(skb, TCA_IFE_TM, sizeof(t), &t, TCA_IFE_PAD))
                goto nla_put_failure;
 
        if (!is_zero_ether_addr(ife->eth_dst)) {
index 350e134cffb32b04f3e4c2b4b3917051cd55b456..1464f6a09446bf0e36985d0921c9695b0e84b68d 100644 (file)
@@ -275,7 +275,7 @@ static int tcf_ipt_dump(struct sk_buff *skb, struct tc_action *a, int bind, int
        tm.install = jiffies_to_clock_t(jiffies - ipt->tcf_tm.install);
        tm.lastuse = jiffies_to_clock_t(jiffies - ipt->tcf_tm.lastuse);
        tm.expires = jiffies_to_clock_t(ipt->tcf_tm.expires);
-       if (nla_put(skb, TCA_IPT_TM, sizeof (tm), &tm))
+       if (nla_put_64bit(skb, TCA_IPT_TM, sizeof(tm), &tm, TCA_IPT_PAD))
                goto nla_put_failure;
        kfree(t);
        return skb->len;
index e8a760cf7775ea1e3c9522376c3e3111a54a2ba6..dea57c1ec90c31f73d3edfde057a92e0693590ab 100644 (file)
@@ -214,7 +214,7 @@ static int tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a, int bind, i
        t.install = jiffies_to_clock_t(jiffies - m->tcf_tm.install);
        t.lastuse = jiffies_to_clock_t(jiffies - m->tcf_tm.lastuse);
        t.expires = jiffies_to_clock_t(m->tcf_tm.expires);
-       if (nla_put(skb, TCA_MIRRED_TM, sizeof(t), &t))
+       if (nla_put_64bit(skb, TCA_MIRRED_TM, sizeof(t), &t, TCA_MIRRED_PAD))
                goto nla_put_failure;
        return skb->len;
 
index 0f65cdfbfb1d364529feaf701f1c188bb9570973..c0a879f940de1b8d7477936a50bb6beee91176aa 100644 (file)
@@ -267,7 +267,7 @@ static int tcf_nat_dump(struct sk_buff *skb, struct tc_action *a,
        t.install = jiffies_to_clock_t(jiffies - p->tcf_tm.install);
        t.lastuse = jiffies_to_clock_t(jiffies - p->tcf_tm.lastuse);
        t.expires = jiffies_to_clock_t(p->tcf_tm.expires);
-       if (nla_put(skb, TCA_NAT_TM, sizeof(t), &t))
+       if (nla_put_64bit(skb, TCA_NAT_TM, sizeof(t), &t, TCA_NAT_PAD))
                goto nla_put_failure;
 
        return skb->len;
index 429c3ab65142671e1d6d12a92b991fa5aec55a04..c6e18f230af690879686d868ad560e091e993443 100644 (file)
@@ -203,7 +203,7 @@ static int tcf_pedit_dump(struct sk_buff *skb, struct tc_action *a,
        t.install = jiffies_to_clock_t(jiffies - p->tcf_tm.install);
        t.lastuse = jiffies_to_clock_t(jiffies - p->tcf_tm.lastuse);
        t.expires = jiffies_to_clock_t(p->tcf_tm.expires);
-       if (nla_put(skb, TCA_PEDIT_TM, sizeof(t), &t))
+       if (nla_put_64bit(skb, TCA_PEDIT_TM, sizeof(t), &t, TCA_PEDIT_PAD))
                goto nla_put_failure;
        kfree(opt);
        return skb->len;
index 75b2be13fbcc452da0a1379dd693fd9693b75e4d..2057fd56d74c401edc8a43257e5144c4375a5495 100644 (file)
@@ -155,7 +155,7 @@ static int tcf_simp_dump(struct sk_buff *skb, struct tc_action *a,
        t.install = jiffies_to_clock_t(jiffies - d->tcf_tm.install);
        t.lastuse = jiffies_to_clock_t(jiffies - d->tcf_tm.lastuse);
        t.expires = jiffies_to_clock_t(d->tcf_tm.expires);
-       if (nla_put(skb, TCA_DEF_TM, sizeof(t), &t))
+       if (nla_put_64bit(skb, TCA_DEF_TM, sizeof(t), &t, TCA_DEF_PAD))
                goto nla_put_failure;
        return skb->len;
 
index cfcdbdc00c9bfef4702ae09875080cc0b3df11ea..51b24998904f68764c5232ec8c6b7d5a0b053653 100644 (file)
@@ -167,7 +167,7 @@ static int tcf_skbedit_dump(struct sk_buff *skb, struct tc_action *a,
        t.install = jiffies_to_clock_t(jiffies - d->tcf_tm.install);
        t.lastuse = jiffies_to_clock_t(jiffies - d->tcf_tm.lastuse);
        t.expires = jiffies_to_clock_t(d->tcf_tm.expires);
-       if (nla_put(skb, TCA_SKBEDIT_TM, sizeof(t), &t))
+       if (nla_put_64bit(skb, TCA_SKBEDIT_TM, sizeof(t), &t, TCA_SKBEDIT_PAD))
                goto nla_put_failure;
        return skb->len;
 
index bab8ae0cefc08800678415b163921c67a0e50e4e..c1682ab9bc7ec342ea8a6322eca0595bdfaba5e4 100644 (file)
@@ -175,7 +175,7 @@ static int tcf_vlan_dump(struct sk_buff *skb, struct tc_action *a,
        t.install = jiffies_to_clock_t(jiffies - v->tcf_tm.install);
        t.lastuse = jiffies_to_clock_t(jiffies - v->tcf_tm.lastuse);
        t.expires = jiffies_to_clock_t(v->tcf_tm.expires);
-       if (nla_put(skb, TCA_VLAN_TM, sizeof(t), &t))
+       if (nla_put_64bit(skb, TCA_VLAN_TM, sizeof(t), &t, TCA_VLAN_PAD))
                goto nla_put_failure;
        return skb->len;
 
index 563cdad764485a2fbce96dcf27c4f777ea7d186e..e64877a3c084339de22c08270d4cdb3a496b5c6d 100644 (file)
@@ -1140,9 +1140,10 @@ static int u32_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
                                gpf->kcnts[i] += pf->kcnts[i];
                }
 
-               if (nla_put(skb, TCA_U32_PCNT,
-                           sizeof(struct tc_u32_pcnt) + n->sel.nkeys*sizeof(u64),
-                           gpf)) {
+               if (nla_put_64bit(skb, TCA_U32_PCNT,
+                                 sizeof(struct tc_u32_pcnt) +
+                                 n->sel.nkeys * sizeof(u64),
+                                 gpf, TCA_U32_PAD)) {
                        kfree(gpf);
                        goto nla_put_failure;
                }
index 3b180ff72f79f838deac16ce9fc69e9ef28b2c0c..64f71a2155f3ae8199123c0ee635fc9fa420c35b 100644 (file)
@@ -1365,7 +1365,8 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid,
                goto nla_put_failure;
 
        if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, TCA_XSTATS,
-                                        qdisc_root_sleeping_lock(q), &d) < 0)
+                                        qdisc_root_sleeping_lock(q), &d,
+                                        TCA_PAD) < 0)
                goto nla_put_failure;
 
        if (q->ops->dump_stats && q->ops->dump_stats(q, &d) < 0)
@@ -1679,7 +1680,8 @@ static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q,
                goto nla_put_failure;
 
        if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, TCA_XSTATS,
-                                        qdisc_root_sleeping_lock(q), &d) < 0)
+                                        qdisc_root_sleeping_lock(q), &d,
+                                        TCA_PAD) < 0)
                goto nla_put_failure;
 
        if (cl_ops->dump_stats && cl_ops->dump_stats(q, cl, &d) < 0)