diff options
author | David S. Miller <davem@davemloft.net> | 2016-04-26 12:00:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-26 12:00:50 -0400 |
commit | 9c9f261d6e3b1084816e9e2df794a55df16e7387 (patch) | |
tree | 96d3d6f4024f7a79010bea763f5922315d7bd63f | |
parent | fab7b629a82da1b59620470d13152aff975239f6 (diff) | |
parent | 9854518ea04db33738602d45ebc96a200e6f5198 (diff) |
Merge branch 'nla_align-set-4'
Nicolas Dichtel says:
====================
netlink: align attributes when needed (patchset #3)
This is the continuation (series #3) of the work done to align netlink
attributes when these attributes contain some 64-bit fields.
It's the last patchset from what I've seen.
The last user of nla_put_u64() is block/drbd. This module does not use
standard netlink API (see all the stuff in include/linux/genl_magic_struct.h
and include/linux/genl_magic_func.h). I didn't modify it because it's seems
hard to do it whithout testing and fully understanding the context (for
example, why include/linux/drbd_genl.h is not part of uapi?).
Any thoughts?
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
48 files changed, 211 insertions, 98 deletions
diff --git a/Documentation/networking/gen_stats.txt b/Documentation/networking/gen_stats.txt index 70e6275b757a..ff630a87b511 100644 --- a/Documentation/networking/gen_stats.txt +++ b/Documentation/networking/gen_stats.txt | |||
@@ -33,7 +33,8 @@ my_dumping_routine(struct sk_buff *skb, ...) | |||
33 | { | 33 | { |
34 | struct gnet_dump dump; | 34 | struct gnet_dump dump; |
35 | 35 | ||
36 | if (gnet_stats_start_copy(skb, TCA_STATS2, &mystruct->lock, &dump) < 0) | 36 | if (gnet_stats_start_copy(skb, TCA_STATS2, &mystruct->lock, &dump, |
37 | TCA_PAD) < 0) | ||
37 | goto rtattr_failure; | 38 | goto rtattr_failure; |
38 | 39 | ||
39 | if (gnet_stats_copy_basic(&dump, &mystruct->bstats) < 0 || | 40 | if (gnet_stats_copy_basic(&dump, &mystruct->bstats) < 0 || |
@@ -56,7 +57,8 @@ existing TLV types. | |||
56 | my_dumping_routine(struct sk_buff *skb, ...) | 57 | my_dumping_routine(struct sk_buff *skb, ...) |
57 | { | 58 | { |
58 | if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, | 59 | if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, |
59 | TCA_XSTATS, &mystruct->lock, &dump) < 0) | 60 | TCA_XSTATS, &mystruct->lock, &dump, |
61 | TCA_PAD) < 0) | ||
60 | goto rtattr_failure; | 62 | goto rtattr_failure; |
61 | ... | 63 | ... |
62 | } | 64 | } |
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c index 6caa72402de7..a172a1ffa151 100644 --- a/drivers/net/macsec.c +++ b/drivers/net/macsec.c | |||
@@ -1405,9 +1405,10 @@ static sci_t nla_get_sci(const struct nlattr *nla) | |||
1405 | return (__force sci_t)nla_get_u64(nla); | 1405 | return (__force sci_t)nla_get_u64(nla); |
1406 | } | 1406 | } |
1407 | 1407 | ||
1408 | static int nla_put_sci(struct sk_buff *skb, int attrtype, sci_t value) | 1408 | static int nla_put_sci(struct sk_buff *skb, int attrtype, sci_t value, |
1409 | int padattr) | ||
1409 | { | 1410 | { |
1410 | return nla_put_u64(skb, attrtype, (__force u64)value); | 1411 | return nla_put_u64_64bit(skb, attrtype, (__force u64)value, padattr); |
1411 | } | 1412 | } |
1412 | 1413 | ||
1413 | static struct macsec_tx_sa *get_txsa_from_nl(struct net *net, | 1414 | static struct macsec_tx_sa *get_txsa_from_nl(struct net *net, |
@@ -2131,16 +2132,36 @@ static int copy_rx_sc_stats(struct sk_buff *skb, | |||
2131 | sum.InPktsUnusedSA += tmp.InPktsUnusedSA; | 2132 | sum.InPktsUnusedSA += tmp.InPktsUnusedSA; |
2132 | } | 2133 | } |
2133 | 2134 | ||
2134 | if (nla_put_u64(skb, MACSEC_RXSC_STATS_ATTR_IN_OCTETS_VALIDATED, sum.InOctetsValidated) || | 2135 | if (nla_put_u64_64bit(skb, MACSEC_RXSC_STATS_ATTR_IN_OCTETS_VALIDATED, |
2135 | nla_put_u64(skb, MACSEC_RXSC_STATS_ATTR_IN_OCTETS_DECRYPTED, sum.InOctetsDecrypted) || | 2136 | sum.InOctetsValidated, |
2136 | nla_put_u64(skb, MACSEC_RXSC_STATS_ATTR_IN_PKTS_UNCHECKED, sum.InPktsUnchecked) || | 2137 | MACSEC_RXSC_STATS_ATTR_PAD) || |
2137 | nla_put_u64(skb, MACSEC_RXSC_STATS_ATTR_IN_PKTS_DELAYED, sum.InPktsDelayed) || | 2138 | nla_put_u64_64bit(skb, MACSEC_RXSC_STATS_ATTR_IN_OCTETS_DECRYPTED, |
2138 | nla_put_u64(skb, MACSEC_RXSC_STATS_ATTR_IN_PKTS_OK, sum.InPktsOK) || | 2139 | sum.InOctetsDecrypted, |
2139 | nla_put_u64(skb, MACSEC_RXSC_STATS_ATTR_IN_PKTS_INVALID, sum.InPktsInvalid) || | 2140 | MACSEC_RXSC_STATS_ATTR_PAD) || |
2140 | nla_put_u64(skb, MACSEC_RXSC_STATS_ATTR_IN_PKTS_LATE, sum.InPktsLate) || | 2141 | nla_put_u64_64bit(skb, MACSEC_RXSC_STATS_ATTR_IN_PKTS_UNCHECKED, |
2141 | nla_put_u64(skb, MACSEC_RXSC_STATS_ATTR_IN_PKTS_NOT_VALID, sum.InPktsNotValid) || | 2142 | sum.InPktsUnchecked, |
2142 | nla_put_u64(skb, MACSEC_RXSC_STATS_ATTR_IN_PKTS_NOT_USING_SA, sum.InPktsNotUsingSA) || | 2143 | MACSEC_RXSC_STATS_ATTR_PAD) || |
2143 | nla_put_u64(skb, MACSEC_RXSC_STATS_ATTR_IN_PKTS_UNUSED_SA, sum.InPktsUnusedSA)) | 2144 | nla_put_u64_64bit(skb, MACSEC_RXSC_STATS_ATTR_IN_PKTS_DELAYED, |
2145 | sum.InPktsDelayed, | ||
2146 | MACSEC_RXSC_STATS_ATTR_PAD) || | ||
2147 | nla_put_u64_64bit(skb, MACSEC_RXSC_STATS_ATTR_IN_PKTS_OK, | ||
2148 | sum.InPktsOK, | ||
2149 | MACSEC_RXSC_STATS_ATTR_PAD) || | ||
2150 | nla_put_u64_64bit(skb, MACSEC_RXSC_STATS_ATTR_IN_PKTS_INVALID, | ||
2151 | sum.InPktsInvalid, | ||
2152 | MACSEC_RXSC_STATS_ATTR_PAD) || | ||
2153 | nla_put_u64_64bit(skb, MACSEC_RXSC_STATS_ATTR_IN_PKTS_LATE, | ||
2154 | sum.InPktsLate, | ||
2155 | MACSEC_RXSC_STATS_ATTR_PAD) || | ||
2156 | nla_put_u64_64bit(skb, MACSEC_RXSC_STATS_ATTR_IN_PKTS_NOT_VALID, | ||
2157 | sum.InPktsNotValid, | ||
2158 | MACSEC_RXSC_STATS_ATTR_PAD) || | ||
2159 | nla_put_u64_64bit(skb, MACSEC_RXSC_STATS_ATTR_IN_PKTS_NOT_USING_SA, | ||
2160 | sum.InPktsNotUsingSA, | ||
2161 | MACSEC_RXSC_STATS_ATTR_PAD) || | ||
2162 | nla_put_u64_64bit(skb, MACSEC_RXSC_STATS_ATTR_IN_PKTS_UNUSED_SA, | ||
2163 | sum.InPktsUnusedSA, | ||
2164 | MACSEC_RXSC_STATS_ATTR_PAD)) | ||
2144 | return -EMSGSIZE; | 2165 | return -EMSGSIZE; |
2145 | 2166 | ||
2146 | return 0; | 2167 | return 0; |
@@ -2169,10 +2190,18 @@ static int copy_tx_sc_stats(struct sk_buff *skb, | |||
2169 | sum.OutOctetsEncrypted += tmp.OutOctetsEncrypted; | 2190 | sum.OutOctetsEncrypted += tmp.OutOctetsEncrypted; |
2170 | } | 2191 | } |
2171 | 2192 | ||
2172 | if (nla_put_u64(skb, MACSEC_TXSC_STATS_ATTR_OUT_PKTS_PROTECTED, sum.OutPktsProtected) || | 2193 | if (nla_put_u64_64bit(skb, MACSEC_TXSC_STATS_ATTR_OUT_PKTS_PROTECTED, |
2173 | nla_put_u64(skb, MACSEC_TXSC_STATS_ATTR_OUT_PKTS_ENCRYPTED, sum.OutPktsEncrypted) || | 2194 | sum.OutPktsProtected, |
2174 | nla_put_u64(skb, MACSEC_TXSC_STATS_ATTR_OUT_OCTETS_PROTECTED, sum.OutOctetsProtected) || | 2195 | MACSEC_TXSC_STATS_ATTR_PAD) || |
2175 | nla_put_u64(skb, MACSEC_TXSC_STATS_ATTR_OUT_OCTETS_ENCRYPTED, sum.OutOctetsEncrypted)) | 2196 | nla_put_u64_64bit(skb, MACSEC_TXSC_STATS_ATTR_OUT_PKTS_ENCRYPTED, |
2197 | sum.OutPktsEncrypted, | ||
2198 | MACSEC_TXSC_STATS_ATTR_PAD) || | ||
2199 | nla_put_u64_64bit(skb, MACSEC_TXSC_STATS_ATTR_OUT_OCTETS_PROTECTED, | ||
2200 | sum.OutOctetsProtected, | ||
2201 | MACSEC_TXSC_STATS_ATTR_PAD) || | ||
2202 | nla_put_u64_64bit(skb, MACSEC_TXSC_STATS_ATTR_OUT_OCTETS_ENCRYPTED, | ||
2203 | sum.OutOctetsEncrypted, | ||
2204 | MACSEC_TXSC_STATS_ATTR_PAD)) | ||
2176 | return -EMSGSIZE; | 2205 | return -EMSGSIZE; |
2177 | 2206 | ||
2178 | return 0; | 2207 | return 0; |
@@ -2205,14 +2234,30 @@ static int copy_secy_stats(struct sk_buff *skb, | |||
2205 | sum.InPktsOverrun += tmp.InPktsOverrun; | 2234 | sum.InPktsOverrun += tmp.InPktsOverrun; |
2206 | } | 2235 | } |
2207 | 2236 | ||
2208 | if (nla_put_u64(skb, MACSEC_SECY_STATS_ATTR_OUT_PKTS_UNTAGGED, sum.OutPktsUntagged) || | 2237 | if (nla_put_u64_64bit(skb, MACSEC_SECY_STATS_ATTR_OUT_PKTS_UNTAGGED, |
2209 | nla_put_u64(skb, MACSEC_SECY_STATS_ATTR_IN_PKTS_UNTAGGED, sum.InPktsUntagged) || | 2238 | sum.OutPktsUntagged, |
2210 | nla_put_u64(skb, MACSEC_SECY_STATS_ATTR_OUT_PKTS_TOO_LONG, sum.OutPktsTooLong) || | 2239 | MACSEC_SECY_STATS_ATTR_PAD) || |
2211 | nla_put_u64(skb, MACSEC_SECY_STATS_ATTR_IN_PKTS_NO_TAG, sum.InPktsNoTag) || | 2240 | nla_put_u64_64bit(skb, MACSEC_SECY_STATS_ATTR_IN_PKTS_UNTAGGED, |
2212 | nla_put_u64(skb, MACSEC_SECY_STATS_ATTR_IN_PKTS_BAD_TAG, sum.InPktsBadTag) || | 2241 | sum.InPktsUntagged, |
2213 | nla_put_u64(skb, MACSEC_SECY_STATS_ATTR_IN_PKTS_UNKNOWN_SCI, sum.InPktsUnknownSCI) || | 2242 | MACSEC_SECY_STATS_ATTR_PAD) || |
2214 | nla_put_u64(skb, MACSEC_SECY_STATS_ATTR_IN_PKTS_NO_SCI, sum.InPktsNoSCI) || | 2243 | nla_put_u64_64bit(skb, MACSEC_SECY_STATS_ATTR_OUT_PKTS_TOO_LONG, |
2215 | nla_put_u64(skb, MACSEC_SECY_STATS_ATTR_IN_PKTS_OVERRUN, sum.InPktsOverrun)) | 2244 | sum.OutPktsTooLong, |
2245 | MACSEC_SECY_STATS_ATTR_PAD) || | ||
2246 | nla_put_u64_64bit(skb, MACSEC_SECY_STATS_ATTR_IN_PKTS_NO_TAG, | ||
2247 | sum.InPktsNoTag, | ||
2248 | MACSEC_SECY_STATS_ATTR_PAD) || | ||
2249 | nla_put_u64_64bit(skb, MACSEC_SECY_STATS_ATTR_IN_PKTS_BAD_TAG, | ||
2250 | sum.InPktsBadTag, | ||
2251 | MACSEC_SECY_STATS_ATTR_PAD) || | ||
2252 | nla_put_u64_64bit(skb, MACSEC_SECY_STATS_ATTR_IN_PKTS_UNKNOWN_SCI, | ||
2253 | sum.InPktsUnknownSCI, | ||
2254 | MACSEC_SECY_STATS_ATTR_PAD) || | ||
2255 | nla_put_u64_64bit(skb, MACSEC_SECY_STATS_ATTR_IN_PKTS_NO_SCI, | ||
2256 | sum.InPktsNoSCI, | ||
2257 | MACSEC_SECY_STATS_ATTR_PAD) || | ||
2258 | nla_put_u64_64bit(skb, MACSEC_SECY_STATS_ATTR_IN_PKTS_OVERRUN, | ||
2259 | sum.InPktsOverrun, | ||
2260 | MACSEC_SECY_STATS_ATTR_PAD)) | ||
2216 | return -EMSGSIZE; | 2261 | return -EMSGSIZE; |
2217 | 2262 | ||
2218 | return 0; | 2263 | return 0; |
@@ -2226,8 +2271,11 @@ static int nla_put_secy(struct macsec_secy *secy, struct sk_buff *skb) | |||
2226 | if (!secy_nest) | 2271 | if (!secy_nest) |
2227 | return 1; | 2272 | return 1; |
2228 | 2273 | ||
2229 | if (nla_put_sci(skb, MACSEC_SECY_ATTR_SCI, secy->sci) || | 2274 | if (nla_put_sci(skb, MACSEC_SECY_ATTR_SCI, secy->sci, |
2230 | nla_put_u64(skb, MACSEC_SECY_ATTR_CIPHER_SUITE, DEFAULT_CIPHER_ID) || | 2275 | MACSEC_SECY_ATTR_PAD) || |
2276 | nla_put_u64_64bit(skb, MACSEC_SECY_ATTR_CIPHER_SUITE, | ||
2277 | DEFAULT_CIPHER_ID, | ||
2278 | MACSEC_SECY_ATTR_PAD) || | ||
2231 | nla_put_u8(skb, MACSEC_SECY_ATTR_ICV_LEN, secy->icv_len) || | 2279 | nla_put_u8(skb, MACSEC_SECY_ATTR_ICV_LEN, secy->icv_len) || |
2232 | nla_put_u8(skb, MACSEC_SECY_ATTR_OPER, secy->operational) || | 2280 | nla_put_u8(skb, MACSEC_SECY_ATTR_OPER, secy->operational) || |
2233 | nla_put_u8(skb, MACSEC_SECY_ATTR_PROTECT, secy->protect_frames) || | 2281 | nla_put_u8(skb, MACSEC_SECY_ATTR_PROTECT, secy->protect_frames) || |
@@ -2312,7 +2360,9 @@ static int dump_secy(struct macsec_secy *secy, struct net_device *dev, | |||
2312 | 2360 | ||
2313 | if (nla_put_u8(skb, MACSEC_SA_ATTR_AN, i) || | 2361 | if (nla_put_u8(skb, MACSEC_SA_ATTR_AN, i) || |
2314 | nla_put_u32(skb, MACSEC_SA_ATTR_PN, tx_sa->next_pn) || | 2362 | nla_put_u32(skb, MACSEC_SA_ATTR_PN, tx_sa->next_pn) || |
2315 | nla_put_u64(skb, MACSEC_SA_ATTR_KEYID, tx_sa->key.id) || | 2363 | nla_put_u64_64bit(skb, MACSEC_SA_ATTR_KEYID, |
2364 | tx_sa->key.id, | ||
2365 | MACSEC_SA_ATTR_PAD) || | ||
2316 | nla_put_u8(skb, MACSEC_SA_ATTR_ACTIVE, tx_sa->active)) { | 2366 | nla_put_u8(skb, MACSEC_SA_ATTR_ACTIVE, tx_sa->active)) { |
2317 | nla_nest_cancel(skb, txsa_nest); | 2367 | nla_nest_cancel(skb, txsa_nest); |
2318 | nla_nest_cancel(skb, txsa_list); | 2368 | nla_nest_cancel(skb, txsa_list); |
@@ -2353,7 +2403,8 @@ static int dump_secy(struct macsec_secy *secy, struct net_device *dev, | |||
2353 | } | 2403 | } |
2354 | 2404 | ||
2355 | if (nla_put_u8(skb, MACSEC_RXSC_ATTR_ACTIVE, rx_sc->active) || | 2405 | if (nla_put_u8(skb, MACSEC_RXSC_ATTR_ACTIVE, rx_sc->active) || |
2356 | nla_put_sci(skb, MACSEC_RXSC_ATTR_SCI, rx_sc->sci)) { | 2406 | nla_put_sci(skb, MACSEC_RXSC_ATTR_SCI, rx_sc->sci, |
2407 | MACSEC_RXSC_ATTR_PAD)) { | ||
2357 | nla_nest_cancel(skb, rxsc_nest); | 2408 | nla_nest_cancel(skb, rxsc_nest); |
2358 | nla_nest_cancel(skb, rxsc_list); | 2409 | nla_nest_cancel(skb, rxsc_list); |
2359 | goto nla_put_failure; | 2410 | goto nla_put_failure; |
@@ -2413,7 +2464,9 @@ static int dump_secy(struct macsec_secy *secy, struct net_device *dev, | |||
2413 | 2464 | ||
2414 | if (nla_put_u8(skb, MACSEC_SA_ATTR_AN, i) || | 2465 | if (nla_put_u8(skb, MACSEC_SA_ATTR_AN, i) || |
2415 | nla_put_u32(skb, MACSEC_SA_ATTR_PN, rx_sa->next_pn) || | 2466 | nla_put_u32(skb, MACSEC_SA_ATTR_PN, rx_sa->next_pn) || |
2416 | nla_put_u64(skb, MACSEC_SA_ATTR_KEYID, rx_sa->key.id) || | 2467 | nla_put_u64_64bit(skb, MACSEC_SA_ATTR_KEYID, |
2468 | rx_sa->key.id, | ||
2469 | MACSEC_SA_ATTR_PAD) || | ||
2417 | nla_put_u8(skb, MACSEC_SA_ATTR_ACTIVE, rx_sa->active)) { | 2470 | nla_put_u8(skb, MACSEC_SA_ATTR_ACTIVE, rx_sa->active)) { |
2418 | nla_nest_cancel(skb, rxsa_nest); | 2471 | nla_nest_cancel(skb, rxsa_nest); |
2419 | nla_nest_cancel(skb, rxsc_nest); | 2472 | nla_nest_cancel(skb, rxsc_nest); |
@@ -3145,9 +3198,9 @@ static struct net *macsec_get_link_net(const struct net_device *dev) | |||
3145 | static size_t macsec_get_size(const struct net_device *dev) | 3198 | static size_t macsec_get_size(const struct net_device *dev) |
3146 | { | 3199 | { |
3147 | return 0 + | 3200 | return 0 + |
3148 | nla_total_size(8) + /* SCI */ | 3201 | nla_total_size_64bit(8) + /* SCI */ |
3149 | nla_total_size(1) + /* ICV_LEN */ | 3202 | nla_total_size(1) + /* ICV_LEN */ |
3150 | nla_total_size(8) + /* CIPHER_SUITE */ | 3203 | nla_total_size_64bit(8) + /* CIPHER_SUITE */ |
3151 | nla_total_size(4) + /* WINDOW */ | 3204 | nla_total_size(4) + /* WINDOW */ |
3152 | nla_total_size(1) + /* ENCODING_SA */ | 3205 | nla_total_size(1) + /* ENCODING_SA */ |
3153 | nla_total_size(1) + /* ENCRYPT */ | 3206 | nla_total_size(1) + /* ENCRYPT */ |
@@ -3166,9 +3219,11 @@ static int macsec_fill_info(struct sk_buff *skb, | |||
3166 | struct macsec_secy *secy = &macsec_priv(dev)->secy; | 3219 | struct macsec_secy *secy = &macsec_priv(dev)->secy; |
3167 | struct macsec_tx_sc *tx_sc = &secy->tx_sc; | 3220 | struct macsec_tx_sc *tx_sc = &secy->tx_sc; |
3168 | 3221 | ||
3169 | if (nla_put_sci(skb, IFLA_MACSEC_SCI, secy->sci) || | 3222 | if (nla_put_sci(skb, IFLA_MACSEC_SCI, secy->sci, |
3223 | IFLA_MACSEC_PAD) || | ||
3170 | nla_put_u8(skb, IFLA_MACSEC_ICV_LEN, secy->icv_len) || | 3224 | nla_put_u8(skb, IFLA_MACSEC_ICV_LEN, secy->icv_len) || |
3171 | nla_put_u64(skb, IFLA_MACSEC_CIPHER_SUITE, DEFAULT_CIPHER_ID) || | 3225 | nla_put_u64_64bit(skb, IFLA_MACSEC_CIPHER_SUITE, |
3226 | DEFAULT_CIPHER_ID, IFLA_MACSEC_PAD) || | ||
3172 | nla_put_u8(skb, IFLA_MACSEC_ENCODING_SA, tx_sc->encoding_sa) || | 3227 | nla_put_u8(skb, IFLA_MACSEC_ENCODING_SA, tx_sc->encoding_sa) || |
3173 | nla_put_u8(skb, IFLA_MACSEC_ENCRYPT, tx_sc->encrypt) || | 3228 | nla_put_u8(skb, IFLA_MACSEC_ENCRYPT, tx_sc->encrypt) || |
3174 | nla_put_u8(skb, IFLA_MACSEC_PROTECT, secy->protect_frames) || | 3229 | nla_put_u8(skb, IFLA_MACSEC_PROTECT, secy->protect_frames) || |
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index c757f14c4c00..9ed0ed1bf514 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
@@ -1030,7 +1030,7 @@ static void mac80211_hwsim_tx_frame_nl(struct ieee80211_hw *hw, | |||
1030 | data->pending_cookie++; | 1030 | data->pending_cookie++; |
1031 | cookie = data->pending_cookie; | 1031 | cookie = data->pending_cookie; |
1032 | info->rate_driver_data[0] = (void *)cookie; | 1032 | info->rate_driver_data[0] = (void *)cookie; |
1033 | if (nla_put_u64(skb, HWSIM_ATTR_COOKIE, cookie)) | 1033 | if (nla_put_u64_64bit(skb, HWSIM_ATTR_COOKIE, cookie, HWSIM_ATTR_PAD)) |
1034 | goto nla_put_failure; | 1034 | goto nla_put_failure; |
1035 | 1035 | ||
1036 | genlmsg_end(skb, msg_head); | 1036 | genlmsg_end(skb, msg_head); |
diff --git a/drivers/net/wireless/mac80211_hwsim.h b/drivers/net/wireless/mac80211_hwsim.h index 66e1c73bd507..39f22467ca2a 100644 --- a/drivers/net/wireless/mac80211_hwsim.h +++ b/drivers/net/wireless/mac80211_hwsim.h | |||
@@ -148,6 +148,7 @@ enum { | |||
148 | HWSIM_ATTR_RADIO_NAME, | 148 | HWSIM_ATTR_RADIO_NAME, |
149 | HWSIM_ATTR_NO_VIF, | 149 | HWSIM_ATTR_NO_VIF, |
150 | HWSIM_ATTR_FREQ, | 150 | HWSIM_ATTR_FREQ, |
151 | HWSIM_ATTR_PAD, | ||
151 | __HWSIM_ATTR_MAX, | 152 | __HWSIM_ATTR_MAX, |
152 | }; | 153 | }; |
153 | #define HWSIM_ATTR_MAX (__HWSIM_ATTR_MAX - 1) | 154 | #define HWSIM_ATTR_MAX (__HWSIM_ATTR_MAX - 1) |
diff --git a/fs/quota/netlink.c b/fs/quota/netlink.c index d07a2f91d858..8b252673d454 100644 --- a/fs/quota/netlink.c +++ b/fs/quota/netlink.c | |||
@@ -47,7 +47,7 @@ void quota_send_warning(struct kqid qid, dev_t dev, | |||
47 | void *msg_head; | 47 | void *msg_head; |
48 | int ret; | 48 | int ret; |
49 | int msg_size = 4 * nla_total_size(sizeof(u32)) + | 49 | int msg_size = 4 * nla_total_size(sizeof(u32)) + |
50 | 2 * nla_total_size(sizeof(u64)); | 50 | 2 * nla_total_size_64bit(sizeof(u64)); |
51 | 51 | ||
52 | /* We have to allocate using GFP_NOFS as we are called from a | 52 | /* We have to allocate using GFP_NOFS as we are called from a |
53 | * filesystem performing write and thus further recursion into | 53 | * filesystem performing write and thus further recursion into |
@@ -68,8 +68,9 @@ void quota_send_warning(struct kqid qid, dev_t dev, | |||
68 | ret = nla_put_u32(skb, QUOTA_NL_A_QTYPE, qid.type); | 68 | ret = nla_put_u32(skb, QUOTA_NL_A_QTYPE, qid.type); |
69 | if (ret) | 69 | if (ret) |
70 | goto attr_err_out; | 70 | goto attr_err_out; |
71 | ret = nla_put_u64(skb, QUOTA_NL_A_EXCESS_ID, | 71 | ret = nla_put_u64_64bit(skb, QUOTA_NL_A_EXCESS_ID, |
72 | from_kqid_munged(&init_user_ns, qid)); | 72 | from_kqid_munged(&init_user_ns, qid), |
73 | QUOTA_NL_A_PAD); | ||
73 | if (ret) | 74 | if (ret) |
74 | goto attr_err_out; | 75 | goto attr_err_out; |
75 | ret = nla_put_u32(skb, QUOTA_NL_A_WARNING, warntype); | 76 | ret = nla_put_u32(skb, QUOTA_NL_A_WARNING, warntype); |
@@ -81,8 +82,9 @@ void quota_send_warning(struct kqid qid, dev_t dev, | |||
81 | ret = nla_put_u32(skb, QUOTA_NL_A_DEV_MINOR, MINOR(dev)); | 82 | ret = nla_put_u32(skb, QUOTA_NL_A_DEV_MINOR, MINOR(dev)); |
82 | if (ret) | 83 | if (ret) |
83 | goto attr_err_out; | 84 | goto attr_err_out; |
84 | ret = nla_put_u64(skb, QUOTA_NL_A_CAUSED_ID, | 85 | ret = nla_put_u64_64bit(skb, QUOTA_NL_A_CAUSED_ID, |
85 | from_kuid_munged(&init_user_ns, current_uid())); | 86 | from_kuid_munged(&init_user_ns, current_uid()), |
87 | QUOTA_NL_A_PAD); | ||
86 | if (ret) | 88 | if (ret) |
87 | goto attr_err_out; | 89 | goto attr_err_out; |
88 | genlmsg_end(skb, msg_head); | 90 | genlmsg_end(skb, msg_head); |
diff --git a/include/net/gen_stats.h b/include/net/gen_stats.h index cbafa3768d48..610cd397890e 100644 --- a/include/net/gen_stats.h +++ b/include/net/gen_stats.h | |||
@@ -19,17 +19,19 @@ struct gnet_dump { | |||
19 | /* Backward compatibility */ | 19 | /* Backward compatibility */ |
20 | int compat_tc_stats; | 20 | int compat_tc_stats; |
21 | int compat_xstats; | 21 | int compat_xstats; |
22 | int padattr; | ||
22 | void * xstats; | 23 | void * xstats; |
23 | int xstats_len; | 24 | int xstats_len; |
24 | struct tc_stats tc_stats; | 25 | struct tc_stats tc_stats; |
25 | }; | 26 | }; |
26 | 27 | ||
27 | int gnet_stats_start_copy(struct sk_buff *skb, int type, spinlock_t *lock, | 28 | int gnet_stats_start_copy(struct sk_buff *skb, int type, spinlock_t *lock, |
28 | struct gnet_dump *d); | 29 | struct gnet_dump *d, int padattr); |
29 | 30 | ||
30 | int gnet_stats_start_copy_compat(struct sk_buff *skb, int type, | 31 | int gnet_stats_start_copy_compat(struct sk_buff *skb, int type, |
31 | int tc_stats_type, int xstats_type, | 32 | int tc_stats_type, int xstats_type, |
32 | spinlock_t *lock, struct gnet_dump *d); | 33 | spinlock_t *lock, struct gnet_dump *d, |
34 | int padattr); | ||
33 | 35 | ||
34 | int gnet_stats_copy_basic(struct gnet_dump *d, | 36 | int gnet_stats_copy_basic(struct gnet_dump *d, |
35 | struct gnet_stats_basic_cpu __percpu *cpu, | 37 | struct gnet_stats_basic_cpu __percpu *cpu, |
diff --git a/include/uapi/linux/gen_stats.h b/include/uapi/linux/gen_stats.h index 6487317ea619..52deccc2128e 100644 --- a/include/uapi/linux/gen_stats.h +++ b/include/uapi/linux/gen_stats.h | |||
@@ -10,6 +10,7 @@ enum { | |||
10 | TCA_STATS_QUEUE, | 10 | TCA_STATS_QUEUE, |
11 | TCA_STATS_APP, | 11 | TCA_STATS_APP, |
12 | TCA_STATS_RATE_EST64, | 12 | TCA_STATS_RATE_EST64, |
13 | TCA_STATS_PAD, | ||
13 | __TCA_STATS_MAX, | 14 | __TCA_STATS_MAX, |
14 | }; | 15 | }; |
15 | #define TCA_STATS_MAX (__TCA_STATS_MAX - 1) | 16 | #define TCA_STATS_MAX (__TCA_STATS_MAX - 1) |
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h index 9300c08346c8..d82de331bb6b 100644 --- a/include/uapi/linux/if_link.h +++ b/include/uapi/linux/if_link.h | |||
@@ -434,6 +434,7 @@ enum { | |||
434 | IFLA_MACSEC_SCB, | 434 | IFLA_MACSEC_SCB, |
435 | IFLA_MACSEC_REPLAY_PROTECT, | 435 | IFLA_MACSEC_REPLAY_PROTECT, |
436 | IFLA_MACSEC_VALIDATION, | 436 | IFLA_MACSEC_VALIDATION, |
437 | IFLA_MACSEC_PAD, | ||
437 | __IFLA_MACSEC_MAX, | 438 | __IFLA_MACSEC_MAX, |
438 | }; | 439 | }; |
439 | 440 | ||
diff --git a/include/uapi/linux/if_macsec.h b/include/uapi/linux/if_macsec.h index 26b0d1e3e3e7..4c623d617b84 100644 --- a/include/uapi/linux/if_macsec.h +++ b/include/uapi/linux/if_macsec.h | |||
@@ -55,6 +55,7 @@ enum macsec_secy_attrs { | |||
55 | MACSEC_SECY_ATTR_INC_SCI, | 55 | MACSEC_SECY_ATTR_INC_SCI, |
56 | MACSEC_SECY_ATTR_ES, | 56 | MACSEC_SECY_ATTR_ES, |
57 | MACSEC_SECY_ATTR_SCB, | 57 | MACSEC_SECY_ATTR_SCB, |
58 | MACSEC_SECY_ATTR_PAD, | ||
58 | __MACSEC_SECY_ATTR_END, | 59 | __MACSEC_SECY_ATTR_END, |
59 | NUM_MACSEC_SECY_ATTR = __MACSEC_SECY_ATTR_END, | 60 | NUM_MACSEC_SECY_ATTR = __MACSEC_SECY_ATTR_END, |
60 | MACSEC_SECY_ATTR_MAX = __MACSEC_SECY_ATTR_END - 1, | 61 | MACSEC_SECY_ATTR_MAX = __MACSEC_SECY_ATTR_END - 1, |
@@ -66,6 +67,7 @@ enum macsec_rxsc_attrs { | |||
66 | MACSEC_RXSC_ATTR_ACTIVE, /* config/dump, u8 0..1 */ | 67 | MACSEC_RXSC_ATTR_ACTIVE, /* config/dump, u8 0..1 */ |
67 | MACSEC_RXSC_ATTR_SA_LIST, /* dump, nested */ | 68 | MACSEC_RXSC_ATTR_SA_LIST, /* dump, nested */ |
68 | MACSEC_RXSC_ATTR_STATS, /* dump, nested, macsec_rxsc_stats_attr */ | 69 | MACSEC_RXSC_ATTR_STATS, /* dump, nested, macsec_rxsc_stats_attr */ |
70 | MACSEC_RXSC_ATTR_PAD, | ||
69 | __MACSEC_RXSC_ATTR_END, | 71 | __MACSEC_RXSC_ATTR_END, |
70 | NUM_MACSEC_RXSC_ATTR = __MACSEC_RXSC_ATTR_END, | 72 | NUM_MACSEC_RXSC_ATTR = __MACSEC_RXSC_ATTR_END, |
71 | MACSEC_RXSC_ATTR_MAX = __MACSEC_RXSC_ATTR_END - 1, | 73 | MACSEC_RXSC_ATTR_MAX = __MACSEC_RXSC_ATTR_END - 1, |
@@ -79,6 +81,7 @@ enum macsec_sa_attrs { | |||
79 | MACSEC_SA_ATTR_KEY, /* config, data */ | 81 | MACSEC_SA_ATTR_KEY, /* config, data */ |
80 | MACSEC_SA_ATTR_KEYID, /* config/dump, u64 */ | 82 | MACSEC_SA_ATTR_KEYID, /* config/dump, u64 */ |
81 | MACSEC_SA_ATTR_STATS, /* dump, nested, macsec_sa_stats_attr */ | 83 | MACSEC_SA_ATTR_STATS, /* dump, nested, macsec_sa_stats_attr */ |
84 | MACSEC_SA_ATTR_PAD, | ||
82 | __MACSEC_SA_ATTR_END, | 85 | __MACSEC_SA_ATTR_END, |
83 | NUM_MACSEC_SA_ATTR = __MACSEC_SA_ATTR_END, | 86 | NUM_MACSEC_SA_ATTR = __MACSEC_SA_ATTR_END, |
84 | MACSEC_SA_ATTR_MAX = __MACSEC_SA_ATTR_END - 1, | 87 | MACSEC_SA_ATTR_MAX = __MACSEC_SA_ATTR_END - 1, |
@@ -110,6 +113,7 @@ enum macsec_rxsc_stats_attr { | |||
110 | MACSEC_RXSC_STATS_ATTR_IN_PKTS_NOT_VALID, | 113 | MACSEC_RXSC_STATS_ATTR_IN_PKTS_NOT_VALID, |
111 | MACSEC_RXSC_STATS_ATTR_IN_PKTS_NOT_USING_SA, | 114 | MACSEC_RXSC_STATS_ATTR_IN_PKTS_NOT_USING_SA, |
112 | MACSEC_RXSC_STATS_ATTR_IN_PKTS_UNUSED_SA, | 115 | MACSEC_RXSC_STATS_ATTR_IN_PKTS_UNUSED_SA, |
116 | MACSEC_RXSC_STATS_ATTR_PAD, | ||
113 | __MACSEC_RXSC_STATS_ATTR_END, | 117 | __MACSEC_RXSC_STATS_ATTR_END, |
114 | NUM_MACSEC_RXSC_STATS_ATTR = __MACSEC_RXSC_STATS_ATTR_END, | 118 | NUM_MACSEC_RXSC_STATS_ATTR = __MACSEC_RXSC_STATS_ATTR_END, |
115 | MACSEC_RXSC_STATS_ATTR_MAX = __MACSEC_RXSC_STATS_ATTR_END - 1, | 119 | MACSEC_RXSC_STATS_ATTR_MAX = __MACSEC_RXSC_STATS_ATTR_END - 1, |
@@ -137,6 +141,7 @@ enum macsec_txsc_stats_attr { | |||
137 | MACSEC_TXSC_STATS_ATTR_OUT_PKTS_ENCRYPTED, | 141 | MACSEC_TXSC_STATS_ATTR_OUT_PKTS_ENCRYPTED, |
138 | MACSEC_TXSC_STATS_ATTR_OUT_OCTETS_PROTECTED, | 142 | MACSEC_TXSC_STATS_ATTR_OUT_OCTETS_PROTECTED, |
139 | MACSEC_TXSC_STATS_ATTR_OUT_OCTETS_ENCRYPTED, | 143 | MACSEC_TXSC_STATS_ATTR_OUT_OCTETS_ENCRYPTED, |
144 | MACSEC_TXSC_STATS_ATTR_PAD, | ||
140 | __MACSEC_TXSC_STATS_ATTR_END, | 145 | __MACSEC_TXSC_STATS_ATTR_END, |
141 | NUM_MACSEC_TXSC_STATS_ATTR = __MACSEC_TXSC_STATS_ATTR_END, | 146 | NUM_MACSEC_TXSC_STATS_ATTR = __MACSEC_TXSC_STATS_ATTR_END, |
142 | MACSEC_TXSC_STATS_ATTR_MAX = __MACSEC_TXSC_STATS_ATTR_END - 1, | 147 | MACSEC_TXSC_STATS_ATTR_MAX = __MACSEC_TXSC_STATS_ATTR_END - 1, |
@@ -153,6 +158,7 @@ enum macsec_secy_stats_attr { | |||
153 | MACSEC_SECY_STATS_ATTR_IN_PKTS_UNKNOWN_SCI, | 158 | MACSEC_SECY_STATS_ATTR_IN_PKTS_UNKNOWN_SCI, |
154 | MACSEC_SECY_STATS_ATTR_IN_PKTS_NO_SCI, | 159 | MACSEC_SECY_STATS_ATTR_IN_PKTS_NO_SCI, |
155 | MACSEC_SECY_STATS_ATTR_IN_PKTS_OVERRUN, | 160 | MACSEC_SECY_STATS_ATTR_IN_PKTS_OVERRUN, |
161 | MACSEC_SECY_STATS_ATTR_PAD, | ||
156 | __MACSEC_SECY_STATS_ATTR_END, | 162 | __MACSEC_SECY_STATS_ATTR_END, |
157 | NUM_MACSEC_SECY_STATS_ATTR = __MACSEC_SECY_STATS_ATTR_END, | 163 | NUM_MACSEC_SECY_STATS_ATTR = __MACSEC_SECY_STATS_ATTR_END, |
158 | MACSEC_SECY_STATS_ATTR_MAX = __MACSEC_SECY_STATS_ATTR_END - 1, | 164 | MACSEC_SECY_STATS_ATTR_MAX = __MACSEC_SECY_STATS_ATTR_END - 1, |
diff --git a/include/uapi/linux/inet_diag.h b/include/uapi/linux/inet_diag.h index f5f3629dd553..a16643705669 100644 --- a/include/uapi/linux/inet_diag.h +++ b/include/uapi/linux/inet_diag.h | |||
@@ -115,9 +115,11 @@ enum { | |||
115 | INET_DIAG_SKV6ONLY, | 115 | INET_DIAG_SKV6ONLY, |
116 | INET_DIAG_LOCALS, | 116 | INET_DIAG_LOCALS, |
117 | INET_DIAG_PEERS, | 117 | INET_DIAG_PEERS, |
118 | INET_DIAG_PAD, | ||
119 | __INET_DIAG_MAX, | ||
118 | }; | 120 | }; |
119 | 121 | ||
120 | #define INET_DIAG_MAX INET_DIAG_SKV6ONLY | 122 | #define INET_DIAG_MAX (__INET_DIAG_MAX - 1) |
121 | 123 | ||
122 | /* INET_DIAG_MEM */ | 124 | /* INET_DIAG_MEM */ |
123 | 125 | ||
diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h index d6be1fb778a5..bb0d515b7654 100644 --- a/include/uapi/linux/openvswitch.h +++ b/include/uapi/linux/openvswitch.h | |||
@@ -84,6 +84,7 @@ enum ovs_datapath_attr { | |||
84 | OVS_DP_ATTR_STATS, /* struct ovs_dp_stats */ | 84 | OVS_DP_ATTR_STATS, /* struct ovs_dp_stats */ |
85 | OVS_DP_ATTR_MEGAFLOW_STATS, /* struct ovs_dp_megaflow_stats */ | 85 | OVS_DP_ATTR_MEGAFLOW_STATS, /* struct ovs_dp_megaflow_stats */ |
86 | OVS_DP_ATTR_USER_FEATURES, /* OVS_DP_F_* */ | 86 | OVS_DP_ATTR_USER_FEATURES, /* OVS_DP_F_* */ |
87 | OVS_DP_ATTR_PAD, | ||
87 | __OVS_DP_ATTR_MAX | 88 | __OVS_DP_ATTR_MAX |
88 | }; | 89 | }; |
89 | 90 | ||
@@ -253,6 +254,7 @@ enum ovs_vport_attr { | |||
253 | OVS_VPORT_ATTR_UPCALL_PID, /* array of u32 Netlink socket PIDs for */ | 254 | OVS_VPORT_ATTR_UPCALL_PID, /* array of u32 Netlink socket PIDs for */ |
254 | /* receiving upcalls */ | 255 | /* receiving upcalls */ |
255 | OVS_VPORT_ATTR_STATS, /* struct ovs_vport_stats */ | 256 | OVS_VPORT_ATTR_STATS, /* struct ovs_vport_stats */ |
257 | OVS_VPORT_ATTR_PAD, | ||
256 | __OVS_VPORT_ATTR_MAX | 258 | __OVS_VPORT_ATTR_MAX |
257 | }; | 259 | }; |
258 | 260 | ||
diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h index c43c5f78b9c4..84660905fedf 100644 --- a/include/uapi/linux/pkt_cls.h +++ b/include/uapi/linux/pkt_cls.h | |||
@@ -66,6 +66,7 @@ enum { | |||
66 | TCA_ACT_OPTIONS, | 66 | TCA_ACT_OPTIONS, |
67 | TCA_ACT_INDEX, | 67 | TCA_ACT_INDEX, |
68 | TCA_ACT_STATS, | 68 | TCA_ACT_STATS, |
69 | TCA_ACT_PAD, | ||
69 | __TCA_ACT_MAX | 70 | __TCA_ACT_MAX |
70 | }; | 71 | }; |
71 | 72 | ||
@@ -173,6 +174,7 @@ enum { | |||
173 | TCA_U32_PCNT, | 174 | TCA_U32_PCNT, |
174 | TCA_U32_MARK, | 175 | TCA_U32_MARK, |
175 | TCA_U32_FLAGS, | 176 | TCA_U32_FLAGS, |
177 | TCA_U32_PAD, | ||
176 | __TCA_U32_MAX | 178 | __TCA_U32_MAX |
177 | }; | 179 | }; |
178 | 180 | ||
diff --git a/include/uapi/linux/quota.h b/include/uapi/linux/quota.h index 38baddb807f5..4d2489ef6f10 100644 --- a/include/uapi/linux/quota.h +++ b/include/uapi/linux/quota.h | |||
@@ -191,6 +191,7 @@ enum { | |||
191 | QUOTA_NL_A_DEV_MAJOR, | 191 | QUOTA_NL_A_DEV_MAJOR, |
192 | QUOTA_NL_A_DEV_MINOR, | 192 | QUOTA_NL_A_DEV_MINOR, |
193 | QUOTA_NL_A_CAUSED_ID, | 193 | QUOTA_NL_A_CAUSED_ID, |
194 | QUOTA_NL_A_PAD, | ||
194 | __QUOTA_NL_A_MAX, | 195 | __QUOTA_NL_A_MAX, |
195 | }; | 196 | }; |
196 | #define QUOTA_NL_A_MAX (__QUOTA_NL_A_MAX - 1) | 197 | #define QUOTA_NL_A_MAX (__QUOTA_NL_A_MAX - 1) |
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h index a94e0b69c769..262f0379d83a 100644 --- a/include/uapi/linux/rtnetlink.h +++ b/include/uapi/linux/rtnetlink.h | |||
@@ -542,6 +542,7 @@ enum { | |||
542 | TCA_FCNT, | 542 | TCA_FCNT, |
543 | TCA_STATS2, | 543 | TCA_STATS2, |
544 | TCA_STAB, | 544 | TCA_STAB, |
545 | TCA_PAD, | ||
545 | __TCA_MAX | 546 | __TCA_MAX |
546 | }; | 547 | }; |
547 | 548 | ||
diff --git a/include/uapi/linux/tc_act/tc_bpf.h b/include/uapi/linux/tc_act/tc_bpf.h index 07f17cc70bb3..063d9d465119 100644 --- a/include/uapi/linux/tc_act/tc_bpf.h +++ b/include/uapi/linux/tc_act/tc_bpf.h | |||
@@ -26,6 +26,7 @@ enum { | |||
26 | TCA_ACT_BPF_OPS, | 26 | TCA_ACT_BPF_OPS, |
27 | TCA_ACT_BPF_FD, | 27 | TCA_ACT_BPF_FD, |
28 | TCA_ACT_BPF_NAME, | 28 | TCA_ACT_BPF_NAME, |
29 | TCA_ACT_BPF_PAD, | ||
29 | __TCA_ACT_BPF_MAX, | 30 | __TCA_ACT_BPF_MAX, |
30 | }; | 31 | }; |
31 | #define TCA_ACT_BPF_MAX (__TCA_ACT_BPF_MAX - 1) | 32 | #define TCA_ACT_BPF_MAX (__TCA_ACT_BPF_MAX - 1) |
diff --git a/include/uapi/linux/tc_act/tc_connmark.h b/include/uapi/linux/tc_act/tc_connmark.h index 994b0971bce2..62a5e944c554 100644 --- a/include/uapi/linux/tc_act/tc_connmark.h +++ b/include/uapi/linux/tc_act/tc_connmark.h | |||
@@ -15,6 +15,7 @@ enum { | |||
15 | TCA_CONNMARK_UNSPEC, | 15 | TCA_CONNMARK_UNSPEC, |
16 | TCA_CONNMARK_PARMS, | 16 | TCA_CONNMARK_PARMS, |
17 | TCA_CONNMARK_TM, | 17 | TCA_CONNMARK_TM, |
18 | TCA_CONNMARK_PAD, | ||
18 | __TCA_CONNMARK_MAX | 19 | __TCA_CONNMARK_MAX |
19 | }; | 20 | }; |
20 | #define TCA_CONNMARK_MAX (__TCA_CONNMARK_MAX - 1) | 21 | #define TCA_CONNMARK_MAX (__TCA_CONNMARK_MAX - 1) |
diff --git a/include/uapi/linux/tc_act/tc_csum.h b/include/uapi/linux/tc_act/tc_csum.h index a047c49a3153..8ac8041ab5f1 100644 --- a/include/uapi/linux/tc_act/tc_csum.h +++ b/include/uapi/linux/tc_act/tc_csum.h | |||
@@ -10,6 +10,7 @@ enum { | |||
10 | TCA_CSUM_UNSPEC, | 10 | TCA_CSUM_UNSPEC, |
11 | TCA_CSUM_PARMS, | 11 | TCA_CSUM_PARMS, |
12 | TCA_CSUM_TM, | 12 | TCA_CSUM_TM, |
13 | TCA_CSUM_PAD, | ||
13 | __TCA_CSUM_MAX | 14 | __TCA_CSUM_MAX |
14 | }; | 15 | }; |
15 | #define TCA_CSUM_MAX (__TCA_CSUM_MAX - 1) | 16 | #define TCA_CSUM_MAX (__TCA_CSUM_MAX - 1) |
diff --git a/include/uapi/linux/tc_act/tc_defact.h b/include/uapi/linux/tc_act/tc_defact.h index 17dddb40f740..d2a3abb77aeb 100644 --- a/include/uapi/linux/tc_act/tc_defact.h +++ b/include/uapi/linux/tc_act/tc_defact.h | |||
@@ -12,6 +12,7 @@ enum { | |||
12 | TCA_DEF_TM, | 12 | TCA_DEF_TM, |
13 | TCA_DEF_PARMS, | 13 | TCA_DEF_PARMS, |
14 | TCA_DEF_DATA, | 14 | TCA_DEF_DATA, |
15 | TCA_DEF_PAD, | ||
15 | __TCA_DEF_MAX | 16 | __TCA_DEF_MAX |
16 | }; | 17 | }; |
17 | #define TCA_DEF_MAX (__TCA_DEF_MAX - 1) | 18 | #define TCA_DEF_MAX (__TCA_DEF_MAX - 1) |
diff --git a/include/uapi/linux/tc_act/tc_gact.h b/include/uapi/linux/tc_act/tc_gact.h index f7bf94eed510..70b536a8f8b2 100644 --- a/include/uapi/linux/tc_act/tc_gact.h +++ b/include/uapi/linux/tc_act/tc_gact.h | |||
@@ -25,6 +25,7 @@ enum { | |||
25 | TCA_GACT_TM, | 25 | TCA_GACT_TM, |
26 | TCA_GACT_PARMS, | 26 | TCA_GACT_PARMS, |
27 | TCA_GACT_PROB, | 27 | TCA_GACT_PROB, |
28 | TCA_GACT_PAD, | ||
28 | __TCA_GACT_MAX | 29 | __TCA_GACT_MAX |
29 | }; | 30 | }; |
30 | #define TCA_GACT_MAX (__TCA_GACT_MAX - 1) | 31 | #define TCA_GACT_MAX (__TCA_GACT_MAX - 1) |
diff --git a/include/uapi/linux/tc_act/tc_ife.h b/include/uapi/linux/tc_act/tc_ife.h index d648ff66586f..4ece02a77b9a 100644 --- a/include/uapi/linux/tc_act/tc_ife.h +++ b/include/uapi/linux/tc_act/tc_ife.h | |||
@@ -23,6 +23,7 @@ enum { | |||
23 | TCA_IFE_SMAC, | 23 | TCA_IFE_SMAC, |
24 | TCA_IFE_TYPE, | 24 | TCA_IFE_TYPE, |
25 | TCA_IFE_METALST, | 25 | TCA_IFE_METALST, |
26 | TCA_IFE_PAD, | ||
26 | __TCA_IFE_MAX | 27 | __TCA_IFE_MAX |
27 | }; | 28 | }; |
28 | #define TCA_IFE_MAX (__TCA_IFE_MAX - 1) | 29 | #define TCA_IFE_MAX (__TCA_IFE_MAX - 1) |
diff --git a/include/uapi/linux/tc_act/tc_ipt.h b/include/uapi/linux/tc_act/tc_ipt.h index 130aaadf6fac..7c6e155dd981 100644 --- a/include/uapi/linux/tc_act/tc_ipt.h +++ b/include/uapi/linux/tc_act/tc_ipt.h | |||
@@ -14,6 +14,7 @@ enum { | |||
14 | TCA_IPT_CNT, | 14 | TCA_IPT_CNT, |
15 | TCA_IPT_TM, | 15 | TCA_IPT_TM, |
16 | TCA_IPT_TARG, | 16 | TCA_IPT_TARG, |
17 | TCA_IPT_PAD, | ||
17 | __TCA_IPT_MAX | 18 | __TCA_IPT_MAX |
18 | }; | 19 | }; |
19 | #define TCA_IPT_MAX (__TCA_IPT_MAX - 1) | 20 | #define TCA_IPT_MAX (__TCA_IPT_MAX - 1) |
diff --git a/include/uapi/linux/tc_act/tc_mirred.h b/include/uapi/linux/tc_act/tc_mirred.h index 7561750e8fd6..3d7a2b352a62 100644 --- a/include/uapi/linux/tc_act/tc_mirred.h +++ b/include/uapi/linux/tc_act/tc_mirred.h | |||
@@ -20,6 +20,7 @@ enum { | |||
20 | TCA_MIRRED_UNSPEC, | 20 | TCA_MIRRED_UNSPEC, |
21 | TCA_MIRRED_TM, | 21 | TCA_MIRRED_TM, |
22 | TCA_MIRRED_PARMS, | 22 | TCA_MIRRED_PARMS, |
23 | TCA_MIRRED_PAD, | ||
23 | __TCA_MIRRED_MAX | 24 | __TCA_MIRRED_MAX |
24 | }; | 25 | }; |
25 | #define TCA_MIRRED_MAX (__TCA_MIRRED_MAX - 1) | 26 | #define TCA_MIRRED_MAX (__TCA_MIRRED_MAX - 1) |
diff --git a/include/uapi/linux/tc_act/tc_nat.h b/include/uapi/linux/tc_act/tc_nat.h index 6663aeba0b9a..923457c9ebf0 100644 --- a/include/uapi/linux/tc_act/tc_nat.h +++ b/include/uapi/linux/tc_act/tc_nat.h | |||
@@ -10,6 +10,7 @@ enum { | |||
10 | TCA_NAT_UNSPEC, | 10 | TCA_NAT_UNSPEC, |
11 | TCA_NAT_PARMS, | 11 | TCA_NAT_PARMS, |
12 | TCA_NAT_TM, | 12 | TCA_NAT_TM, |
13 | TCA_NAT_PAD, | ||
13 | __TCA_NAT_MAX | 14 | __TCA_NAT_MAX |
14 | }; | 15 | }; |
15 | #define TCA_NAT_MAX (__TCA_NAT_MAX - 1) | 16 | #define TCA_NAT_MAX (__TCA_NAT_MAX - 1) |
diff --git a/include/uapi/linux/tc_act/tc_pedit.h b/include/uapi/linux/tc_act/tc_pedit.h index 716cfabcd5b2..6389959a5157 100644 --- a/include/uapi/linux/tc_act/tc_pedit.h +++ b/include/uapi/linux/tc_act/tc_pedit.h | |||
@@ -10,6 +10,7 @@ enum { | |||
10 | TCA_PEDIT_UNSPEC, | 10 | TCA_PEDIT_UNSPEC, |
11 | TCA_PEDIT_TM, | 11 | TCA_PEDIT_TM, |
12 | TCA_PEDIT_PARMS, | 12 | TCA_PEDIT_PARMS, |
13 | TCA_PEDIT_PAD, | ||
13 | __TCA_PEDIT_MAX | 14 | __TCA_PEDIT_MAX |
14 | }; | 15 | }; |
15 | #define TCA_PEDIT_MAX (__TCA_PEDIT_MAX - 1) | 16 | #define TCA_PEDIT_MAX (__TCA_PEDIT_MAX - 1) |
diff --git a/include/uapi/linux/tc_act/tc_skbedit.h b/include/uapi/linux/tc_act/tc_skbedit.h index 7a2e910a5f08..fecb5cc48c40 100644 --- a/include/uapi/linux/tc_act/tc_skbedit.h +++ b/include/uapi/linux/tc_act/tc_skbedit.h | |||
@@ -39,6 +39,7 @@ enum { | |||
39 | TCA_SKBEDIT_PRIORITY, | 39 | TCA_SKBEDIT_PRIORITY, |
40 | TCA_SKBEDIT_QUEUE_MAPPING, | 40 | TCA_SKBEDIT_QUEUE_MAPPING, |
41 | TCA_SKBEDIT_MARK, | 41 | TCA_SKBEDIT_MARK, |
42 | TCA_SKBEDIT_PAD, | ||
42 | __TCA_SKBEDIT_MAX | 43 | __TCA_SKBEDIT_MAX |
43 | }; | 44 | }; |
44 | #define TCA_SKBEDIT_MAX (__TCA_SKBEDIT_MAX - 1) | 45 | #define TCA_SKBEDIT_MAX (__TCA_SKBEDIT_MAX - 1) |
diff --git a/include/uapi/linux/tc_act/tc_vlan.h b/include/uapi/linux/tc_act/tc_vlan.h index f7b8d448b960..31151ff6264f 100644 --- a/include/uapi/linux/tc_act/tc_vlan.h +++ b/include/uapi/linux/tc_act/tc_vlan.h | |||
@@ -28,6 +28,7 @@ enum { | |||
28 | TCA_VLAN_PARMS, | 28 | TCA_VLAN_PARMS, |
29 | TCA_VLAN_PUSH_VLAN_ID, | 29 | TCA_VLAN_PUSH_VLAN_ID, |
30 | TCA_VLAN_PUSH_VLAN_PROTOCOL, | 30 | TCA_VLAN_PUSH_VLAN_PROTOCOL, |
31 | TCA_VLAN_PAD, | ||
31 | __TCA_VLAN_MAX, | 32 | __TCA_VLAN_MAX, |
32 | }; | 33 | }; |
33 | #define TCA_VLAN_MAX (__TCA_VLAN_MAX - 1) | 34 | #define TCA_VLAN_MAX (__TCA_VLAN_MAX - 1) |
diff --git a/net/core/gen_stats.c b/net/core/gen_stats.c index e640462ea8bf..f96ee8b9478d 100644 --- a/net/core/gen_stats.c +++ b/net/core/gen_stats.c | |||
@@ -25,9 +25,9 @@ | |||
25 | 25 | ||
26 | 26 | ||
27 | static inline int | 27 | static inline int |
28 | gnet_stats_copy(struct gnet_dump *d, int type, void *buf, int size) | 28 | gnet_stats_copy(struct gnet_dump *d, int type, void *buf, int size, int padattr) |
29 | { | 29 | { |
30 | if (nla_put(d->skb, type, size, buf)) | 30 | if (nla_put_64bit(d->skb, type, size, buf, padattr)) |
31 | goto nla_put_failure; | 31 | goto nla_put_failure; |
32 | return 0; | 32 | return 0; |
33 | 33 | ||
@@ -59,7 +59,8 @@ nla_put_failure: | |||
59 | */ | 59 | */ |
60 | int | 60 | int |
61 | gnet_stats_start_copy_compat(struct sk_buff *skb, int type, int tc_stats_type, | 61 | gnet_stats_start_copy_compat(struct sk_buff *skb, int type, int tc_stats_type, |
62 | int xstats_type, spinlock_t *lock, struct gnet_dump *d) | 62 | int xstats_type, spinlock_t *lock, |
63 | struct gnet_dump *d, int padattr) | ||
63 | __acquires(lock) | 64 | __acquires(lock) |
64 | { | 65 | { |
65 | memset(d, 0, sizeof(*d)); | 66 | memset(d, 0, sizeof(*d)); |
@@ -71,16 +72,17 @@ gnet_stats_start_copy_compat(struct sk_buff *skb, int type, int tc_stats_type, | |||
71 | d->skb = skb; | 72 | d->skb = skb; |
72 | d->compat_tc_stats = tc_stats_type; | 73 | d->compat_tc_stats = tc_stats_type; |
73 | d->compat_xstats = xstats_type; | 74 | d->compat_xstats = xstats_type; |
75 | d->padattr = padattr; | ||
74 | 76 | ||
75 | if (d->tail) | 77 | if (d->tail) |
76 | return gnet_stats_copy(d, type, NULL, 0); | 78 | return gnet_stats_copy(d, type, NULL, 0, padattr); |
77 | 79 | ||
78 | return 0; | 80 | return 0; |
79 | } | 81 | } |
80 | EXPORT_SYMBOL(gnet_stats_start_copy_compat); | 82 | EXPORT_SYMBOL(gnet_stats_start_copy_compat); |
81 | 83 | ||
82 | /** | 84 | /** |
83 | * gnet_stats_start_copy_compat - start dumping procedure in compatibility mode | 85 | * gnet_stats_start_copy - start dumping procedure in compatibility mode |
84 | * @skb: socket buffer to put statistics TLVs into | 86 | * @skb: socket buffer to put statistics TLVs into |
85 | * @type: TLV type for top level statistic TLV | 87 | * @type: TLV type for top level statistic TLV |
86 | * @lock: statistics lock | 88 | * @lock: statistics lock |
@@ -94,9 +96,9 @@ EXPORT_SYMBOL(gnet_stats_start_copy_compat); | |||
94 | */ | 96 | */ |
95 | int | 97 | int |
96 | gnet_stats_start_copy(struct sk_buff *skb, int type, spinlock_t *lock, | 98 | gnet_stats_start_copy(struct sk_buff *skb, int type, spinlock_t *lock, |
97 | struct gnet_dump *d) | 99 | struct gnet_dump *d, int padattr) |
98 | { | 100 | { |
99 | return gnet_stats_start_copy_compat(skb, type, 0, 0, lock, d); | 101 | return gnet_stats_start_copy_compat(skb, type, 0, 0, lock, d, padattr); |
100 | } | 102 | } |
101 | EXPORT_SYMBOL(gnet_stats_start_copy); | 103 | EXPORT_SYMBOL(gnet_stats_start_copy); |
102 | 104 | ||
@@ -169,7 +171,8 @@ gnet_stats_copy_basic(struct gnet_dump *d, | |||
169 | memset(&sb, 0, sizeof(sb)); | 171 | memset(&sb, 0, sizeof(sb)); |
170 | sb.bytes = bstats.bytes; | 172 | sb.bytes = bstats.bytes; |
171 | sb.packets = bstats.packets; | 173 | sb.packets = bstats.packets; |
172 | return gnet_stats_copy(d, TCA_STATS_BASIC, &sb, sizeof(sb)); | 174 | return gnet_stats_copy(d, TCA_STATS_BASIC, &sb, sizeof(sb), |
175 | TCA_STATS_PAD); | ||
173 | } | 176 | } |
174 | return 0; | 177 | return 0; |
175 | } | 178 | } |
@@ -208,11 +211,13 @@ gnet_stats_copy_rate_est(struct gnet_dump *d, | |||
208 | } | 211 | } |
209 | 212 | ||
210 | if (d->tail) { | 213 | if (d->tail) { |
211 | res = gnet_stats_copy(d, TCA_STATS_RATE_EST, &est, sizeof(est)); | 214 | res = gnet_stats_copy(d, TCA_STATS_RATE_EST, &est, sizeof(est), |
215 | TCA_STATS_PAD); | ||
212 | if (res < 0 || est.bps == r->bps) | 216 | if (res < 0 || est.bps == r->bps) |
213 | return res; | 217 | return res; |
214 | /* emit 64bit stats only if needed */ | 218 | /* emit 64bit stats only if needed */ |
215 | return gnet_stats_copy(d, TCA_STATS_RATE_EST64, r, sizeof(*r)); | 219 | return gnet_stats_copy(d, TCA_STATS_RATE_EST64, r, sizeof(*r), |
220 | TCA_STATS_PAD); | ||
216 | } | 221 | } |
217 | 222 | ||
218 | return 0; | 223 | return 0; |
@@ -286,7 +291,8 @@ gnet_stats_copy_queue(struct gnet_dump *d, | |||
286 | 291 | ||
287 | if (d->tail) | 292 | if (d->tail) |
288 | return gnet_stats_copy(d, TCA_STATS_QUEUE, | 293 | return gnet_stats_copy(d, TCA_STATS_QUEUE, |
289 | &qstats, sizeof(qstats)); | 294 | &qstats, sizeof(qstats), |
295 | TCA_STATS_PAD); | ||
290 | 296 | ||
291 | return 0; | 297 | return 0; |
292 | } | 298 | } |
@@ -316,7 +322,8 @@ gnet_stats_copy_app(struct gnet_dump *d, void *st, int len) | |||
316 | } | 322 | } |
317 | 323 | ||
318 | if (d->tail) | 324 | if (d->tail) |
319 | return gnet_stats_copy(d, TCA_STATS_APP, st, len); | 325 | return gnet_stats_copy(d, TCA_STATS_APP, st, len, |
326 | TCA_STATS_PAD); | ||
320 | 327 | ||
321 | return 0; | 328 | return 0; |
322 | 329 | ||
@@ -347,12 +354,12 @@ gnet_stats_finish_copy(struct gnet_dump *d) | |||
347 | 354 | ||
348 | if (d->compat_tc_stats) | 355 | if (d->compat_tc_stats) |
349 | if (gnet_stats_copy(d, d->compat_tc_stats, &d->tc_stats, | 356 | if (gnet_stats_copy(d, d->compat_tc_stats, &d->tc_stats, |
350 | sizeof(d->tc_stats)) < 0) | 357 | sizeof(d->tc_stats), d->padattr) < 0) |
351 | return -1; | 358 | return -1; |
352 | 359 | ||
353 | if (d->compat_xstats && d->xstats) { | 360 | if (d->compat_xstats && d->xstats) { |
354 | if (gnet_stats_copy(d, d->compat_xstats, d->xstats, | 361 | if (gnet_stats_copy(d, d->compat_xstats, d->xstats, |
355 | d->xstats_len) < 0) | 362 | d->xstats_len, d->padattr) < 0) |
356 | return -1; | 363 | return -1; |
357 | } | 364 | } |
358 | 365 | ||
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 6a395d440228..29dd8cc22bbf 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -1857,7 +1857,8 @@ static int neightbl_fill_info(struct sk_buff *skb, struct neigh_table *tbl, | |||
1857 | ndst.ndts_table_fulls += st->table_fulls; | 1857 | ndst.ndts_table_fulls += st->table_fulls; |
1858 | } | 1858 | } |
1859 | 1859 | ||
1860 | if (nla_put(skb, NDTA_STATS, sizeof(ndst), &ndst)) | 1860 | if (nla_put_64bit(skb, NDTA_STATS, sizeof(ndst), &ndst, |
1861 | NDTA_PAD)) | ||
1861 | goto nla_put_failure; | 1862 | goto nla_put_failure; |
1862 | } | 1863 | } |
1863 | 1864 | ||
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 9efc1f34ef3b..5503dfe6a050 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -876,7 +876,7 @@ static noinline size_t if_nlmsg_size(const struct net_device *dev, | |||
876 | + nla_total_size(IFNAMSIZ) /* IFLA_IFNAME */ | 876 | + nla_total_size(IFNAMSIZ) /* IFLA_IFNAME */ |
877 | + nla_total_size(IFALIASZ) /* IFLA_IFALIAS */ | 877 | + nla_total_size(IFALIASZ) /* IFLA_IFALIAS */ |
878 | + nla_total_size(IFNAMSIZ) /* IFLA_QDISC */ | 878 | + nla_total_size(IFNAMSIZ) /* IFLA_QDISC */ |
879 | + nla_total_size(sizeof(struct rtnl_link_ifmap)) | 879 | + nla_total_size_64bit(sizeof(struct rtnl_link_ifmap)) |
880 | + nla_total_size(sizeof(struct rtnl_link_stats)) | 880 | + nla_total_size(sizeof(struct rtnl_link_stats)) |
881 | + nla_total_size_64bit(sizeof(struct rtnl_link_stats64)) | 881 | + nla_total_size_64bit(sizeof(struct rtnl_link_stats64)) |
882 | + nla_total_size(MAX_ADDR_LEN) /* IFLA_ADDRESS */ | 882 | + nla_total_size(MAX_ADDR_LEN) /* IFLA_ADDRESS */ |
@@ -1181,7 +1181,7 @@ static int rtnl_fill_link_ifmap(struct sk_buff *skb, struct net_device *dev) | |||
1181 | .dma = dev->dma, | 1181 | .dma = dev->dma, |
1182 | .port = dev->if_port, | 1182 | .port = dev->if_port, |
1183 | }; | 1183 | }; |
1184 | if (nla_put(skb, IFLA_MAP, sizeof(map), &map)) | 1184 | if (nla_put_64bit(skb, IFLA_MAP, sizeof(map), &map, IFLA_PAD)) |
1185 | return -EMSGSIZE; | 1185 | return -EMSGSIZE; |
1186 | 1186 | ||
1187 | return 0; | 1187 | return 0; |
diff --git a/net/core/sock_diag.c b/net/core/sock_diag.c index ca9e35bbe13c..6b10573cc9fa 100644 --- a/net/core/sock_diag.c +++ b/net/core/sock_diag.c | |||
@@ -120,7 +120,7 @@ static size_t sock_diag_nlmsg_size(void) | |||
120 | { | 120 | { |
121 | return NLMSG_ALIGN(sizeof(struct inet_diag_msg) | 121 | return NLMSG_ALIGN(sizeof(struct inet_diag_msg) |
122 | + nla_total_size(sizeof(u8)) /* INET_DIAG_PROTOCOL */ | 122 | + nla_total_size(sizeof(u8)) /* INET_DIAG_PROTOCOL */ |
123 | + nla_total_size(sizeof(struct tcp_info))); /* INET_DIAG_INFO */ | 123 | + nla_total_size_64bit(sizeof(struct tcp_info))); /* INET_DIAG_INFO */ |
124 | } | 124 | } |
125 | 125 | ||
126 | static void sock_diag_broadcast_destroy_work(struct work_struct *work) | 126 | static void sock_diag_broadcast_destroy_work(struct work_struct *work) |
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index ad7956fa659a..25af1243649b 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
@@ -220,8 +220,9 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk, | |||
220 | } | 220 | } |
221 | 221 | ||
222 | if ((ext & (1 << (INET_DIAG_INFO - 1))) && handler->idiag_info_size) { | 222 | if ((ext & (1 << (INET_DIAG_INFO - 1))) && handler->idiag_info_size) { |
223 | attr = nla_reserve(skb, INET_DIAG_INFO, | 223 | attr = nla_reserve_64bit(skb, INET_DIAG_INFO, |
224 | handler->idiag_info_size); | 224 | handler->idiag_info_size, |
225 | INET_DIAG_PAD); | ||
225 | if (!attr) | 226 | if (!attr) |
226 | goto errout; | 227 | goto errout; |
227 | 228 | ||
@@ -1078,7 +1079,9 @@ int inet_diag_handler_get_info(struct sk_buff *skb, struct sock *sk) | |||
1078 | } | 1079 | } |
1079 | 1080 | ||
1080 | attr = handler->idiag_info_size | 1081 | attr = handler->idiag_info_size |
1081 | ? nla_reserve(skb, INET_DIAG_INFO, handler->idiag_info_size) | 1082 | ? nla_reserve_64bit(skb, INET_DIAG_INFO, |
1083 | handler->idiag_info_size, | ||
1084 | INET_DIAG_PAD) | ||
1082 | : NULL; | 1085 | : NULL; |
1083 | if (attr) | 1086 | if (attr) |
1084 | info = nla_data(attr); | 1087 | info = nla_data(attr); |
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 22d9a5316304..856bd8dba676 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
@@ -738,9 +738,9 @@ static size_t ovs_flow_cmd_msg_size(const struct sw_flow_actions *acts, | |||
738 | len += nla_total_size(acts->orig_len); | 738 | len += nla_total_size(acts->orig_len); |
739 | 739 | ||
740 | return len | 740 | return len |
741 | + nla_total_size(sizeof(struct ovs_flow_stats)) /* OVS_FLOW_ATTR_STATS */ | 741 | + nla_total_size_64bit(sizeof(struct ovs_flow_stats)) /* OVS_FLOW_ATTR_STATS */ |
742 | + nla_total_size(1) /* OVS_FLOW_ATTR_TCP_FLAGS */ | 742 | + nla_total_size(1) /* OVS_FLOW_ATTR_TCP_FLAGS */ |
743 | + nla_total_size(8); /* OVS_FLOW_ATTR_USED */ | 743 | + nla_total_size_64bit(8); /* OVS_FLOW_ATTR_USED */ |
744 | } | 744 | } |
745 | 745 | ||
746 | /* Called with ovs_mutex or RCU read lock. */ | 746 | /* Called with ovs_mutex or RCU read lock. */ |
@@ -759,7 +759,9 @@ static int ovs_flow_cmd_fill_stats(const struct sw_flow *flow, | |||
759 | return -EMSGSIZE; | 759 | return -EMSGSIZE; |
760 | 760 | ||
761 | if (stats.n_packets && | 761 | if (stats.n_packets && |
762 | nla_put(skb, OVS_FLOW_ATTR_STATS, sizeof(struct ovs_flow_stats), &stats)) | 762 | nla_put_64bit(skb, OVS_FLOW_ATTR_STATS, |
763 | sizeof(struct ovs_flow_stats), &stats, | ||
764 | OVS_FLOW_ATTR_PAD)) | ||
763 | return -EMSGSIZE; | 765 | return -EMSGSIZE; |
764 | 766 | ||
765 | if ((u8)ntohs(tcp_flags) && | 767 | if ((u8)ntohs(tcp_flags) && |
@@ -1435,8 +1437,8 @@ static size_t ovs_dp_cmd_msg_size(void) | |||
1435 | size_t msgsize = NLMSG_ALIGN(sizeof(struct ovs_header)); | 1437 | size_t msgsize = NLMSG_ALIGN(sizeof(struct ovs_header)); |
1436 | 1438 | ||
1437 | msgsize += nla_total_size(IFNAMSIZ); | 1439 | msgsize += nla_total_size(IFNAMSIZ); |
1438 | msgsize += nla_total_size(sizeof(struct ovs_dp_stats)); | 1440 | msgsize += nla_total_size_64bit(sizeof(struct ovs_dp_stats)); |
1439 | msgsize += nla_total_size(sizeof(struct ovs_dp_megaflow_stats)); | 1441 | msgsize += nla_total_size_64bit(sizeof(struct ovs_dp_megaflow_stats)); |
1440 | msgsize += nla_total_size(sizeof(u32)); /* OVS_DP_ATTR_USER_FEATURES */ | 1442 | msgsize += nla_total_size(sizeof(u32)); /* OVS_DP_ATTR_USER_FEATURES */ |
1441 | 1443 | ||
1442 | return msgsize; | 1444 | return msgsize; |
@@ -1463,13 +1465,13 @@ static int ovs_dp_cmd_fill_info(struct datapath *dp, struct sk_buff *skb, | |||
1463 | goto nla_put_failure; | 1465 | goto nla_put_failure; |
1464 | 1466 | ||
1465 | get_dp_stats(dp, &dp_stats, &dp_megaflow_stats); | 1467 | get_dp_stats(dp, &dp_stats, &dp_megaflow_stats); |
1466 | if (nla_put(skb, OVS_DP_ATTR_STATS, sizeof(struct ovs_dp_stats), | 1468 | if (nla_put_64bit(skb, OVS_DP_ATTR_STATS, sizeof(struct ovs_dp_stats), |
1467 | &dp_stats)) | 1469 | &dp_stats, OVS_DP_ATTR_PAD)) |
1468 | goto nla_put_failure; | 1470 | goto nla_put_failure; |
1469 | 1471 | ||
1470 | if (nla_put(skb, OVS_DP_ATTR_MEGAFLOW_STATS, | 1472 | if (nla_put_64bit(skb, OVS_DP_ATTR_MEGAFLOW_STATS, |
1471 | sizeof(struct ovs_dp_megaflow_stats), | 1473 | sizeof(struct ovs_dp_megaflow_stats), |
1472 | &dp_megaflow_stats)) | 1474 | &dp_megaflow_stats, OVS_DP_ATTR_PAD)) |
1473 | goto nla_put_failure; | 1475 | goto nla_put_failure; |
1474 | 1476 | ||
1475 | if (nla_put_u32(skb, OVS_DP_ATTR_USER_FEATURES, dp->user_features)) | 1477 | if (nla_put_u32(skb, OVS_DP_ATTR_USER_FEATURES, dp->user_features)) |
@@ -1838,8 +1840,9 @@ static int ovs_vport_cmd_fill_info(struct vport *vport, struct sk_buff *skb, | |||
1838 | goto nla_put_failure; | 1840 | goto nla_put_failure; |
1839 | 1841 | ||
1840 | ovs_vport_get_stats(vport, &vport_stats); | 1842 | ovs_vport_get_stats(vport, &vport_stats); |
1841 | if (nla_put(skb, OVS_VPORT_ATTR_STATS, sizeof(struct ovs_vport_stats), | 1843 | if (nla_put_64bit(skb, OVS_VPORT_ATTR_STATS, |
1842 | &vport_stats)) | 1844 | sizeof(struct ovs_vport_stats), &vport_stats, |
1845 | OVS_VPORT_ATTR_PAD)) | ||
1843 | goto nla_put_failure; | 1846 | goto nla_put_failure; |
1844 | 1847 | ||
1845 | if (ovs_vport_get_upcall_portids(vport, skb)) | 1848 | if (ovs_vport_get_upcall_portids(vport, skb)) |
diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 96066665e376..336774a535c3 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c | |||
@@ -657,12 +657,15 @@ int tcf_action_copy_stats(struct sk_buff *skb, struct tc_action *a, | |||
657 | if (compat_mode) { | 657 | if (compat_mode) { |
658 | if (a->type == TCA_OLD_COMPAT) | 658 | if (a->type == TCA_OLD_COMPAT) |
659 | err = gnet_stats_start_copy_compat(skb, 0, | 659 | err = gnet_stats_start_copy_compat(skb, 0, |
660 | TCA_STATS, TCA_XSTATS, &p->tcfc_lock, &d); | 660 | TCA_STATS, |
661 | TCA_XSTATS, | ||
662 | &p->tcfc_lock, &d, | ||
663 | TCA_PAD); | ||
661 | else | 664 | else |
662 | return 0; | 665 | return 0; |
663 | } else | 666 | } else |
664 | err = gnet_stats_start_copy(skb, TCA_ACT_STATS, | 667 | err = gnet_stats_start_copy(skb, TCA_ACT_STATS, |
665 | &p->tcfc_lock, &d); | 668 | &p->tcfc_lock, &d, TCA_ACT_PAD); |
666 | 669 | ||
667 | if (err < 0) | 670 | if (err < 0) |
668 | goto errout; | 671 | goto errout; |
diff --git a/net/sched/act_bpf.c b/net/sched/act_bpf.c index 8c9f1f0459ab..4fd703362563 100644 --- a/net/sched/act_bpf.c +++ b/net/sched/act_bpf.c | |||
@@ -156,7 +156,8 @@ static int tcf_bpf_dump(struct sk_buff *skb, struct tc_action *act, | |||
156 | tm.lastuse = jiffies_to_clock_t(jiffies - prog->tcf_tm.lastuse); | 156 | tm.lastuse = jiffies_to_clock_t(jiffies - prog->tcf_tm.lastuse); |
157 | tm.expires = jiffies_to_clock_t(prog->tcf_tm.expires); | 157 | tm.expires = jiffies_to_clock_t(prog->tcf_tm.expires); |
158 | 158 | ||
159 | if (nla_put(skb, TCA_ACT_BPF_TM, sizeof(tm), &tm)) | 159 | if (nla_put_64bit(skb, TCA_ACT_BPF_TM, sizeof(tm), &tm, |
160 | TCA_ACT_BPF_PAD)) | ||
160 | goto nla_put_failure; | 161 | goto nla_put_failure; |
161 | 162 | ||
162 | return skb->len; | 163 | return skb->len; |
diff --git a/net/sched/act_connmark.c b/net/sched/act_connmark.c index c0ed93ce2391..2ba700c765e0 100644 --- a/net/sched/act_connmark.c +++ b/net/sched/act_connmark.c | |||
@@ -163,7 +163,8 @@ static inline int tcf_connmark_dump(struct sk_buff *skb, struct tc_action *a, | |||
163 | t.install = jiffies_to_clock_t(jiffies - ci->tcf_tm.install); | 163 | t.install = jiffies_to_clock_t(jiffies - ci->tcf_tm.install); |
164 | t.lastuse = jiffies_to_clock_t(jiffies - ci->tcf_tm.lastuse); | 164 | t.lastuse = jiffies_to_clock_t(jiffies - ci->tcf_tm.lastuse); |
165 | t.expires = jiffies_to_clock_t(ci->tcf_tm.expires); | 165 | t.expires = jiffies_to_clock_t(ci->tcf_tm.expires); |
166 | if (nla_put(skb, TCA_CONNMARK_TM, sizeof(t), &t)) | 166 | if (nla_put_64bit(skb, TCA_CONNMARK_TM, sizeof(t), &t, |
167 | TCA_CONNMARK_PAD)) | ||
167 | goto nla_put_failure; | 168 | goto nla_put_failure; |
168 | 169 | ||
169 | return skb->len; | 170 | return skb->len; |
diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c index d22426cdebc0..28e934ed038a 100644 --- a/net/sched/act_csum.c +++ b/net/sched/act_csum.c | |||
@@ -549,7 +549,7 @@ static int tcf_csum_dump(struct sk_buff *skb, | |||
549 | t.install = jiffies_to_clock_t(jiffies - p->tcf_tm.install); | 549 | t.install = jiffies_to_clock_t(jiffies - p->tcf_tm.install); |
550 | t.lastuse = jiffies_to_clock_t(jiffies - p->tcf_tm.lastuse); | 550 | t.lastuse = jiffies_to_clock_t(jiffies - p->tcf_tm.lastuse); |
551 | t.expires = jiffies_to_clock_t(p->tcf_tm.expires); | 551 | t.expires = jiffies_to_clock_t(p->tcf_tm.expires); |
552 | if (nla_put(skb, TCA_CSUM_TM, sizeof(t), &t)) | 552 | if (nla_put_64bit(skb, TCA_CSUM_TM, sizeof(t), &t, TCA_CSUM_PAD)) |
553 | goto nla_put_failure; | 553 | goto nla_put_failure; |
554 | 554 | ||
555 | return skb->len; | 555 | return skb->len; |
diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c index 887fc1f209ff..1a6e09fbb2a5 100644 --- a/net/sched/act_gact.c +++ b/net/sched/act_gact.c | |||
@@ -177,7 +177,7 @@ static int tcf_gact_dump(struct sk_buff *skb, struct tc_action *a, int bind, int | |||
177 | t.install = jiffies_to_clock_t(jiffies - gact->tcf_tm.install); | 177 | t.install = jiffies_to_clock_t(jiffies - gact->tcf_tm.install); |
178 | t.lastuse = jiffies_to_clock_t(jiffies - gact->tcf_tm.lastuse); | 178 | t.lastuse = jiffies_to_clock_t(jiffies - gact->tcf_tm.lastuse); |
179 | t.expires = jiffies_to_clock_t(gact->tcf_tm.expires); | 179 | t.expires = jiffies_to_clock_t(gact->tcf_tm.expires); |
180 | if (nla_put(skb, TCA_GACT_TM, sizeof(t), &t)) | 180 | if (nla_put_64bit(skb, TCA_GACT_TM, sizeof(t), &t, TCA_GACT_PAD)) |
181 | goto nla_put_failure; | 181 | goto nla_put_failure; |
182 | return skb->len; | 182 | return skb->len; |
183 | 183 | ||
diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c index c589a9ba506a..556f44c9c454 100644 --- a/net/sched/act_ife.c +++ b/net/sched/act_ife.c | |||
@@ -550,7 +550,7 @@ static int tcf_ife_dump(struct sk_buff *skb, struct tc_action *a, int bind, | |||
550 | t.install = jiffies_to_clock_t(jiffies - ife->tcf_tm.install); | 550 | t.install = jiffies_to_clock_t(jiffies - ife->tcf_tm.install); |
551 | t.lastuse = jiffies_to_clock_t(jiffies - ife->tcf_tm.lastuse); | 551 | t.lastuse = jiffies_to_clock_t(jiffies - ife->tcf_tm.lastuse); |
552 | t.expires = jiffies_to_clock_t(ife->tcf_tm.expires); | 552 | t.expires = jiffies_to_clock_t(ife->tcf_tm.expires); |
553 | if (nla_put(skb, TCA_IFE_TM, sizeof(t), &t)) | 553 | if (nla_put_64bit(skb, TCA_IFE_TM, sizeof(t), &t, TCA_IFE_PAD)) |
554 | goto nla_put_failure; | 554 | goto nla_put_failure; |
555 | 555 | ||
556 | if (!is_zero_ether_addr(ife->eth_dst)) { | 556 | if (!is_zero_ether_addr(ife->eth_dst)) { |
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c index 350e134cffb3..1464f6a09446 100644 --- a/net/sched/act_ipt.c +++ b/net/sched/act_ipt.c | |||
@@ -275,7 +275,7 @@ static int tcf_ipt_dump(struct sk_buff *skb, struct tc_action *a, int bind, int | |||
275 | tm.install = jiffies_to_clock_t(jiffies - ipt->tcf_tm.install); | 275 | tm.install = jiffies_to_clock_t(jiffies - ipt->tcf_tm.install); |
276 | tm.lastuse = jiffies_to_clock_t(jiffies - ipt->tcf_tm.lastuse); | 276 | tm.lastuse = jiffies_to_clock_t(jiffies - ipt->tcf_tm.lastuse); |
277 | tm.expires = jiffies_to_clock_t(ipt->tcf_tm.expires); | 277 | tm.expires = jiffies_to_clock_t(ipt->tcf_tm.expires); |
278 | if (nla_put(skb, TCA_IPT_TM, sizeof (tm), &tm)) | 278 | if (nla_put_64bit(skb, TCA_IPT_TM, sizeof(tm), &tm, TCA_IPT_PAD)) |
279 | goto nla_put_failure; | 279 | goto nla_put_failure; |
280 | kfree(t); | 280 | kfree(t); |
281 | return skb->len; | 281 | return skb->len; |
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index e8a760cf7775..dea57c1ec90c 100644 --- a/net/sched/act_mirred.c +++ b/net/sched/act_mirred.c | |||
@@ -214,7 +214,7 @@ static int tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a, int bind, i | |||
214 | t.install = jiffies_to_clock_t(jiffies - m->tcf_tm.install); | 214 | t.install = jiffies_to_clock_t(jiffies - m->tcf_tm.install); |
215 | t.lastuse = jiffies_to_clock_t(jiffies - m->tcf_tm.lastuse); | 215 | t.lastuse = jiffies_to_clock_t(jiffies - m->tcf_tm.lastuse); |
216 | t.expires = jiffies_to_clock_t(m->tcf_tm.expires); | 216 | t.expires = jiffies_to_clock_t(m->tcf_tm.expires); |
217 | if (nla_put(skb, TCA_MIRRED_TM, sizeof(t), &t)) | 217 | if (nla_put_64bit(skb, TCA_MIRRED_TM, sizeof(t), &t, TCA_MIRRED_PAD)) |
218 | goto nla_put_failure; | 218 | goto nla_put_failure; |
219 | return skb->len; | 219 | return skb->len; |
220 | 220 | ||
diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c index 0f65cdfbfb1d..c0a879f940de 100644 --- a/net/sched/act_nat.c +++ b/net/sched/act_nat.c | |||
@@ -267,7 +267,7 @@ static int tcf_nat_dump(struct sk_buff *skb, struct tc_action *a, | |||
267 | t.install = jiffies_to_clock_t(jiffies - p->tcf_tm.install); | 267 | t.install = jiffies_to_clock_t(jiffies - p->tcf_tm.install); |
268 | t.lastuse = jiffies_to_clock_t(jiffies - p->tcf_tm.lastuse); | 268 | t.lastuse = jiffies_to_clock_t(jiffies - p->tcf_tm.lastuse); |
269 | t.expires = jiffies_to_clock_t(p->tcf_tm.expires); | 269 | t.expires = jiffies_to_clock_t(p->tcf_tm.expires); |
270 | if (nla_put(skb, TCA_NAT_TM, sizeof(t), &t)) | 270 | if (nla_put_64bit(skb, TCA_NAT_TM, sizeof(t), &t, TCA_NAT_PAD)) |
271 | goto nla_put_failure; | 271 | goto nla_put_failure; |
272 | 272 | ||
273 | return skb->len; | 273 | return skb->len; |
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index 429c3ab65142..c6e18f230af6 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pedit.c | |||
@@ -203,7 +203,7 @@ static int tcf_pedit_dump(struct sk_buff *skb, struct tc_action *a, | |||
203 | t.install = jiffies_to_clock_t(jiffies - p->tcf_tm.install); | 203 | t.install = jiffies_to_clock_t(jiffies - p->tcf_tm.install); |
204 | t.lastuse = jiffies_to_clock_t(jiffies - p->tcf_tm.lastuse); | 204 | t.lastuse = jiffies_to_clock_t(jiffies - p->tcf_tm.lastuse); |
205 | t.expires = jiffies_to_clock_t(p->tcf_tm.expires); | 205 | t.expires = jiffies_to_clock_t(p->tcf_tm.expires); |
206 | if (nla_put(skb, TCA_PEDIT_TM, sizeof(t), &t)) | 206 | if (nla_put_64bit(skb, TCA_PEDIT_TM, sizeof(t), &t, TCA_PEDIT_PAD)) |
207 | goto nla_put_failure; | 207 | goto nla_put_failure; |
208 | kfree(opt); | 208 | kfree(opt); |
209 | return skb->len; | 209 | return skb->len; |
diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c index 75b2be13fbcc..2057fd56d74c 100644 --- a/net/sched/act_simple.c +++ b/net/sched/act_simple.c | |||
@@ -155,7 +155,7 @@ static int tcf_simp_dump(struct sk_buff *skb, struct tc_action *a, | |||
155 | t.install = jiffies_to_clock_t(jiffies - d->tcf_tm.install); | 155 | t.install = jiffies_to_clock_t(jiffies - d->tcf_tm.install); |
156 | t.lastuse = jiffies_to_clock_t(jiffies - d->tcf_tm.lastuse); | 156 | t.lastuse = jiffies_to_clock_t(jiffies - d->tcf_tm.lastuse); |
157 | t.expires = jiffies_to_clock_t(d->tcf_tm.expires); | 157 | t.expires = jiffies_to_clock_t(d->tcf_tm.expires); |
158 | if (nla_put(skb, TCA_DEF_TM, sizeof(t), &t)) | 158 | if (nla_put_64bit(skb, TCA_DEF_TM, sizeof(t), &t, TCA_DEF_PAD)) |
159 | goto nla_put_failure; | 159 | goto nla_put_failure; |
160 | return skb->len; | 160 | return skb->len; |
161 | 161 | ||
diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c index cfcdbdc00c9b..51b24998904f 100644 --- a/net/sched/act_skbedit.c +++ b/net/sched/act_skbedit.c | |||
@@ -167,7 +167,7 @@ static int tcf_skbedit_dump(struct sk_buff *skb, struct tc_action *a, | |||
167 | t.install = jiffies_to_clock_t(jiffies - d->tcf_tm.install); | 167 | t.install = jiffies_to_clock_t(jiffies - d->tcf_tm.install); |
168 | t.lastuse = jiffies_to_clock_t(jiffies - d->tcf_tm.lastuse); | 168 | t.lastuse = jiffies_to_clock_t(jiffies - d->tcf_tm.lastuse); |
169 | t.expires = jiffies_to_clock_t(d->tcf_tm.expires); | 169 | t.expires = jiffies_to_clock_t(d->tcf_tm.expires); |
170 | if (nla_put(skb, TCA_SKBEDIT_TM, sizeof(t), &t)) | 170 | if (nla_put_64bit(skb, TCA_SKBEDIT_TM, sizeof(t), &t, TCA_SKBEDIT_PAD)) |
171 | goto nla_put_failure; | 171 | goto nla_put_failure; |
172 | return skb->len; | 172 | return skb->len; |
173 | 173 | ||
diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c index bab8ae0cefc0..c1682ab9bc7e 100644 --- a/net/sched/act_vlan.c +++ b/net/sched/act_vlan.c | |||
@@ -175,7 +175,7 @@ static int tcf_vlan_dump(struct sk_buff *skb, struct tc_action *a, | |||
175 | t.install = jiffies_to_clock_t(jiffies - v->tcf_tm.install); | 175 | t.install = jiffies_to_clock_t(jiffies - v->tcf_tm.install); |
176 | t.lastuse = jiffies_to_clock_t(jiffies - v->tcf_tm.lastuse); | 176 | t.lastuse = jiffies_to_clock_t(jiffies - v->tcf_tm.lastuse); |
177 | t.expires = jiffies_to_clock_t(v->tcf_tm.expires); | 177 | t.expires = jiffies_to_clock_t(v->tcf_tm.expires); |
178 | if (nla_put(skb, TCA_VLAN_TM, sizeof(t), &t)) | 178 | if (nla_put_64bit(skb, TCA_VLAN_TM, sizeof(t), &t, TCA_VLAN_PAD)) |
179 | goto nla_put_failure; | 179 | goto nla_put_failure; |
180 | return skb->len; | 180 | return skb->len; |
181 | 181 | ||
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 563cdad76448..e64877a3c084 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c | |||
@@ -1140,9 +1140,10 @@ static int u32_dump(struct net *net, struct tcf_proto *tp, unsigned long fh, | |||
1140 | gpf->kcnts[i] += pf->kcnts[i]; | 1140 | gpf->kcnts[i] += pf->kcnts[i]; |
1141 | } | 1141 | } |
1142 | 1142 | ||
1143 | if (nla_put(skb, TCA_U32_PCNT, | 1143 | if (nla_put_64bit(skb, TCA_U32_PCNT, |
1144 | sizeof(struct tc_u32_pcnt) + n->sel.nkeys*sizeof(u64), | 1144 | sizeof(struct tc_u32_pcnt) + |
1145 | gpf)) { | 1145 | n->sel.nkeys * sizeof(u64), |
1146 | gpf, TCA_U32_PAD)) { | ||
1146 | kfree(gpf); | 1147 | kfree(gpf); |
1147 | goto nla_put_failure; | 1148 | goto nla_put_failure; |
1148 | } | 1149 | } |
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 3b180ff72f79..64f71a2155f3 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
@@ -1365,7 +1365,8 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid, | |||
1365 | goto nla_put_failure; | 1365 | goto nla_put_failure; |
1366 | 1366 | ||
1367 | if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, TCA_XSTATS, | 1367 | if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, TCA_XSTATS, |
1368 | qdisc_root_sleeping_lock(q), &d) < 0) | 1368 | qdisc_root_sleeping_lock(q), &d, |
1369 | TCA_PAD) < 0) | ||
1369 | goto nla_put_failure; | 1370 | goto nla_put_failure; |
1370 | 1371 | ||
1371 | if (q->ops->dump_stats && q->ops->dump_stats(q, &d) < 0) | 1372 | 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, | |||
1679 | goto nla_put_failure; | 1680 | goto nla_put_failure; |
1680 | 1681 | ||
1681 | if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, TCA_XSTATS, | 1682 | if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, TCA_XSTATS, |
1682 | qdisc_root_sleeping_lock(q), &d) < 0) | 1683 | qdisc_root_sleeping_lock(q), &d, |
1684 | TCA_PAD) < 0) | ||
1683 | goto nla_put_failure; | 1685 | goto nla_put_failure; |
1684 | 1686 | ||
1685 | if (cl_ops->dump_stats && cl_ops->dump_stats(q, cl, &d) < 0) | 1687 | if (cl_ops->dump_stats && cl_ops->dump_stats(q, cl, &d) < 0) |
diff --git a/net/sctp/sctp_diag.c b/net/sctp/sctp_diag.c index bb2d8d9608e9..84829fff3bc9 100644 --- a/net/sctp/sctp_diag.c +++ b/net/sctp/sctp_diag.c | |||
@@ -161,8 +161,9 @@ static int inet_sctp_diag_fill(struct sock *sk, struct sctp_association *asoc, | |||
161 | if (ext & (1 << (INET_DIAG_INFO - 1))) { | 161 | if (ext & (1 << (INET_DIAG_INFO - 1))) { |
162 | struct nlattr *attr; | 162 | struct nlattr *attr; |
163 | 163 | ||
164 | attr = nla_reserve(skb, INET_DIAG_INFO, | 164 | attr = nla_reserve_64bit(skb, INET_DIAG_INFO, |
165 | sizeof(struct sctp_info)); | 165 | sizeof(struct sctp_info), |
166 | INET_DIAG_PAD); | ||
166 | if (!attr) | 167 | if (!attr) |
167 | goto errout; | 168 | goto errout; |
168 | 169 | ||