Patchwork [GIT,PULL,net-next,17/17] ndisc: Use return value of __skb_put(), instead of icmp6_hdr().

login
register
mail settings
Submitter YOSHIFUJI Hideaki / 吉藤英明
Date Dec. 18, 2012, 10:56 a.m.
Message ID <50D04BDD.3070203@linux-ipv6.org>
Download mbox | patch
Permalink /patch/207071/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

YOSHIFUJI Hideaki / 吉藤英明 - Dec. 18, 2012, 10:56 a.m.
It is safe to use __skb_put() here and it returns buffer for
ICMPv6 header.  Let's use it.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
 net/ipv6/ndisc.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch

diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index e614388..232daea 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1469,8 +1469,7 @@  void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
 	if (!buff)
 		goto release;
 
-	skb_put(buff, sizeof(struct red_msg));
-	msg = (struct red_msg *)icmp6_hdr(buff);
+	msg = (struct red_msg *)__skb_put(buff, sizeof(struct red_msg));
 	*msg = (struct red_msg) {
 		.icmph = {
 			.icmp6_type = NDISC_REDIRECT,