Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347295
b: refs/heads/master
c: 093d04d
h: refs/heads/master
i:
  347293: 96231c4
  347291: efc9156
  347287: 517b1de
  347279: bfc1b8b
  347263: 448456c
v: v3
  • Loading branch information
Duan Jiong authored and David S. Miller committed Dec 14, 2012
1 parent 2bcd7d2 commit 84ebe67
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1e9f954516ee03251e0ac2e98cad2e4be6ce9958
refs/heads/master: 093d04d42fa094f6740bb188f0ad0c215ff61e2c
7 changes: 7 additions & 0 deletions trunk/include/net/ndisc.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ struct ra_msg {
__be32 retrans_timer;
};

struct rd_msg {
struct icmp6hdr icmph;
struct in6_addr target;
struct in6_addr dest;
__u8 opt[0];
};

struct nd_opt_hdr {
__u8 nd_opt_type;
__u8 nd_opt_len;
Expand Down
17 changes: 17 additions & 0 deletions trunk/net/ipv6/ndisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,12 @@ static void ndisc_router_discovery(struct sk_buff *skb)

static void ndisc_redirect_rcv(struct sk_buff *skb)
{
u8 *hdr;
struct ndisc_options ndopts;
struct rd_msg *msg = (struct rd_msg *)skb_transport_header(skb);
u32 ndoptlen = skb->tail - (skb->transport_header +
offsetof(struct rd_msg, opt));

#ifdef CONFIG_IPV6_NDISC_NODETYPE
switch (skb->ndisc_nodetype) {
case NDISC_NODETYPE_HOST:
Expand All @@ -1330,6 +1336,17 @@ static void ndisc_redirect_rcv(struct sk_buff *skb)
return;
}

if (!ndisc_parse_options(msg->opt, ndoptlen, &ndopts))
return;

if (!ndopts.nd_opts_rh)
return;

hdr = (u8 *)ndopts.nd_opts_rh;
hdr += 8;
if (!pskb_pull(skb, hdr - skb_transport_header(skb)))
return;

icmpv6_notify(skb, NDISC_REDIRECT, 0, 0);
}

Expand Down

0 comments on commit 84ebe67

Please sign in to comment.