Skip to content

Commit

Permalink
[IPV6] MIP6: Add sending mobility header functions through raw socket.
Browse files Browse the repository at this point in the history
Mobility header is built by user-space and sent through raw socket.
Kernel just extracts its type to flow.
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 7be96f7 commit 6e8f4d4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions net/ipv6/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,9 @@ static void rawv6_probe_proto_opt(struct flowi *fl, struct msghdr *msg)
struct iovec *iov;
u8 __user *type = NULL;
u8 __user *code = NULL;
#ifdef CONFIG_IPV6_MIP6
u8 len = 0;
#endif
int probed = 0;
int i;

Expand Down Expand Up @@ -640,6 +643,20 @@ static void rawv6_probe_proto_opt(struct flowi *fl, struct msghdr *msg)
probed = 1;
}
break;
#ifdef CONFIG_IPV6_MIP6
case IPPROTO_MH:
if (iov->iov_base && iov->iov_len < 1)
break;
/* check if type field is readable or not. */
if (iov->iov_len > 2 - len) {
u8 __user *p = iov->iov_base;
get_user(fl->fl_mh_type, &p[2 - len]);
probed = 1;
} else
len += iov->iov_len;

break;
#endif
default:
probed = 1;
break;
Expand Down

0 comments on commit 6e8f4d4

Please sign in to comment.