aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/inet_diag.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/inet_diag.c')
-rw-r--r--net/ipv4/inet_diag.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index 5df71cd08da8..37362cd1d07f 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -60,7 +60,7 @@ static int inet_csk_diag_fill(struct sock *sk,
60 struct nlmsghdr *nlh; 60 struct nlmsghdr *nlh;
61 void *info = NULL; 61 void *info = NULL;
62 struct inet_diag_meminfo *minfo = NULL; 62 struct inet_diag_meminfo *minfo = NULL;
63 unsigned char *b = skb->tail; 63 unsigned char *b = skb_tail_pointer(skb);
64 const struct inet_diag_handler *handler; 64 const struct inet_diag_handler *handler;
65 65
66 handler = inet_diag_table[unlh->nlmsg_type]; 66 handler = inet_diag_table[unlh->nlmsg_type];
@@ -147,7 +147,7 @@ static int inet_csk_diag_fill(struct sock *sk,
147 icsk->icsk_ca_ops && icsk->icsk_ca_ops->get_info) 147 icsk->icsk_ca_ops && icsk->icsk_ca_ops->get_info)
148 icsk->icsk_ca_ops->get_info(sk, ext, skb); 148 icsk->icsk_ca_ops->get_info(sk, ext, skb);
149 149
150 nlh->nlmsg_len = skb->tail - b; 150 nlh->nlmsg_len = skb_tail_pointer(skb) - b;
151 return skb->len; 151 return skb->len;
152 152
153rtattr_failure: 153rtattr_failure:
@@ -163,7 +163,7 @@ static int inet_twsk_diag_fill(struct inet_timewait_sock *tw,
163{ 163{
164 long tmo; 164 long tmo;
165 struct inet_diag_msg *r; 165 struct inet_diag_msg *r;
166 const unsigned char *previous_tail = skb->tail; 166 const unsigned char *previous_tail = skb_tail_pointer(skb);
167 struct nlmsghdr *nlh = NLMSG_PUT(skb, pid, seq, 167 struct nlmsghdr *nlh = NLMSG_PUT(skb, pid, seq,
168 unlh->nlmsg_type, sizeof(*r)); 168 unlh->nlmsg_type, sizeof(*r));
169 169
@@ -205,7 +205,7 @@ static int inet_twsk_diag_fill(struct inet_timewait_sock *tw,
205 &tw6->tw_v6_daddr); 205 &tw6->tw_v6_daddr);
206 } 206 }
207#endif 207#endif
208 nlh->nlmsg_len = skb->tail - previous_tail; 208 nlh->nlmsg_len = skb_tail_pointer(skb) - previous_tail;
209 return skb->len; 209 return skb->len;
210nlmsg_failure: 210nlmsg_failure:
211 skb_trim(skb, previous_tail - skb->data); 211 skb_trim(skb, previous_tail - skb->data);
@@ -535,7 +535,7 @@ static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk,
535{ 535{
536 const struct inet_request_sock *ireq = inet_rsk(req); 536 const struct inet_request_sock *ireq = inet_rsk(req);
537 struct inet_sock *inet = inet_sk(sk); 537 struct inet_sock *inet = inet_sk(sk);
538 unsigned char *b = skb->tail; 538 unsigned char *b = skb_tail_pointer(skb);
539 struct inet_diag_msg *r; 539 struct inet_diag_msg *r;
540 struct nlmsghdr *nlh; 540 struct nlmsghdr *nlh;
541 long tmo; 541 long tmo;
@@ -574,7 +574,7 @@ static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk,
574 &inet6_rsk(req)->rmt_addr); 574 &inet6_rsk(req)->rmt_addr);
575 } 575 }
576#endif 576#endif
577 nlh->nlmsg_len = skb->tail - b; 577 nlh->nlmsg_len = skb_tail_pointer(skb) - b;
578 578
579 return skb->len; 579 return skb->len;
580 580