Skip to content

Commit

Permalink
[IPV6] MIP6: Add socket option and ancillary data interface of routin…
Browse files Browse the repository at this point in the history
…g header type 2.

Add socket option and ancillary data interface of routing header type
2.  Mobile IPv6 application will use this to send binding
acknowledgement with the header without relation of confirmed route
optimization (binding).

Based on MIPL2 kernel patch.

Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Masahide NAKAMURA authored and David S. Miller committed Sep 22, 2006
1 parent 65d4ed9 commit 280a9d3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
11 changes: 7 additions & 4 deletions net/ipv6/datagram.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,10 +648,13 @@ int datagram_send_ctl(struct msghdr *msg, struct flowi *fl,

rthdr = (struct ipv6_rt_hdr *)CMSG_DATA(cmsg);

/*
* TYPE 0
*/
if (rthdr->type) {
switch (rthdr->type) {
case IPV6_SRCRT_TYPE_0:
#ifdef CONFIG_IPV6_MIP6
case IPV6_SRCRT_TYPE_2:
#endif
break;
default:
err = -EINVAL;
goto exit_f;
}
Expand Down
10 changes: 9 additions & 1 deletion net/ipv6/ipv6_sockglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,16 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
/* routing header option needs extra check */
if (optname == IPV6_RTHDR && opt->srcrt) {
struct ipv6_rt_hdr *rthdr = opt->srcrt;
if (rthdr->type)
switch (rthdr->type) {
case IPV6_SRCRT_TYPE_0:
#ifdef CONFIG_IPV6_MIP6
case IPV6_SRCRT_TYPE_2:
#endif
break;
default:
goto sticky_done;
}

if ((rthdr->hdrlen & 1) ||
(rthdr->hdrlen >> 1) != rthdr->segments_left)
goto sticky_done;
Expand Down

0 comments on commit 280a9d3

Please sign in to comment.