diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2016-04-26 10:06:14 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-26 12:00:48 -0400 |
commit | 6ed46d1247a595c58b6c04481fa77cf532f45de0 (patch) | |
tree | 16ff8cec378c83d80cb395c152af472fa9fdb3de /net/sctp/sctp_diag.c | |
parent | 3c6f3714d6a9e051eb84759e4fa5a2f4a3e730c6 (diff) |
sock_diag: align nlattr properly when needed
I also fix the value of INET_DIAG_MAX. It's wrong since commit 8f840e47f190
which is only in net-next right now, thus I didn't make a separate patch.
Fixes: 8f840e47f190 ("sctp: add the sctp_diag.c file")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/sctp_diag.c')
-rw-r--r-- | net/sctp/sctp_diag.c | 5 |
1 files changed, 3 insertions, 2 deletions
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, if (ext & (1 << (INET_DIAG_INFO - 1))) { struct nlattr *attr; - attr = nla_reserve(skb, INET_DIAG_INFO, - sizeof(struct sctp_info)); + attr = nla_reserve_64bit(skb, INET_DIAG_INFO, + sizeof(struct sctp_info), + INET_DIAG_PAD); if (!attr) goto errout; |