sock_diag: align nlattr properly when needed
I also fix the value of INET_DIAG_MAX. It's wrong since commit8f840e47f1which is only in net-next right now, thus I didn't make a separate patch. Fixes:8f840e47f1("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>
This commit is contained in:
parent
3c6f3714d6
commit
6ed46d1247
4 changed files with 13 additions and 7 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue