aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_diag.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp_diag.c')
-rw-r--r--net/ipv4/tcp_diag.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c
index 867acc0f79d8..a4e512036d88 100644
--- a/net/ipv4/tcp_diag.c
+++ b/net/ipv4/tcp_diag.c
@@ -43,13 +43,7 @@ struct tcpdiag_entry
43static struct sock *tcpnl; 43static struct sock *tcpnl;
44 44
45#define TCPDIAG_PUT(skb, attrtype, attrlen) \ 45#define TCPDIAG_PUT(skb, attrtype, attrlen) \
46({ int rtalen = RTA_LENGTH(attrlen); \ 46 RTA_DATA(__RTA_PUT(skb, attrtype, attrlen))
47 struct rtattr *rta; \
48 if (skb_tailroom(skb) < RTA_ALIGN(rtalen)) goto nlmsg_failure; \
49 rta = (void*)__skb_put(skb, RTA_ALIGN(rtalen)); \
50 rta->rta_type = attrtype; \
51 rta->rta_len = rtalen; \
52 RTA_DATA(rta); })
53 47
54static int tcpdiag_fill(struct sk_buff *skb, struct sock *sk, 48static int tcpdiag_fill(struct sk_buff *skb, struct sock *sk,
55 int ext, u32 pid, u32 seq, u16 nlmsg_flags) 49 int ext, u32 pid, u32 seq, u16 nlmsg_flags)
@@ -167,6 +161,7 @@ static int tcpdiag_fill(struct sk_buff *skb, struct sock *sk,
167 nlh->nlmsg_len = skb->tail - b; 161 nlh->nlmsg_len = skb->tail - b;
168 return skb->len; 162 return skb->len;
169 163
164rtattr_failure:
170nlmsg_failure: 165nlmsg_failure:
171 skb_trim(skb, b - skb->data); 166 skb_trim(skb, b - skb->data);
172 return -1; 167 return -1;