Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351510
b: refs/heads/master
c: 9c86daf
h: refs/heads/master
v: v3
  • Loading branch information
YOSHIFUJI Hideaki / 吉藤英明 authored and David S. Miller committed Jan 21, 2013
1 parent bc1f453 commit 2ce82fd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6bce6b4e16e46cc860175b9e10a283194ef9f004
refs/heads/master: 9c86dafe94f03679b77d85915e65da1304005a7c
21 changes: 15 additions & 6 deletions trunk/net/ipv6/ndisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,19 @@ static void ndisc_redirect_rcv(struct sk_buff *skb)
icmpv6_notify(skb, NDISC_REDIRECT, 0, 0);
}

static u8 *ndisc_fill_redirect_hdr_option(u8 *opt, struct sk_buff *orig_skb,
int rd_len)
{
memset(opt, 0, 8);
*(opt++) = ND_OPT_REDIRECT_HDR;
*(opt++) = (rd_len >> 3);
opt += 6;

memcpy(opt, ipv6_hdr(orig_skb), rd_len - 8);

return opt + rd_len - 8;
}

void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
{
struct net_device *dev = skb->dev;
Expand Down Expand Up @@ -1470,12 +1483,8 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
* build redirect option and copy skb over to the new packet.
*/

memset(opt, 0, 8);
*(opt++) = ND_OPT_REDIRECT_HDR;
*(opt++) = (rd_len >> 3);
opt += 6;

memcpy(opt, ipv6_hdr(skb), rd_len - 8);
if (rd_len)
opt = ndisc_fill_redirect_hdr_option(opt, skb, rd_len);

msg->icmph.icmp6_cksum = csum_ipv6_magic(&saddr_buf, &ipv6_hdr(skb)->saddr,
len, IPPROTO_ICMPV6,
Expand Down

0 comments on commit 2ce82fd

Please sign in to comment.