Skip to content

Commit 280a9d3

Browse files
Masahide NAKAMURADavid S. Miller
authored andcommitted
[IPV6] MIP6: Add socket option and ancillary data interface of routing 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 <[email protected]> Signed-off-by: YOSHIFUJI Hideaki <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 65d4ed9 commit 280a9d3

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

net/ipv6/datagram.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -648,10 +648,13 @@ int datagram_send_ctl(struct msghdr *msg, struct flowi *fl,
648648

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

651-
/*
652-
* TYPE 0
653-
*/
654-
if (rthdr->type) {
651+
switch (rthdr->type) {
652+
case IPV6_SRCRT_TYPE_0:
653+
#ifdef CONFIG_IPV6_MIP6
654+
case IPV6_SRCRT_TYPE_2:
655+
#endif
656+
break;
657+
default:
655658
err = -EINVAL;
656659
goto exit_f;
657660
}

net/ipv6/ipv6_sockglue.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,16 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
407407
/* routing header option needs extra check */
408408
if (optname == IPV6_RTHDR && opt->srcrt) {
409409
struct ipv6_rt_hdr *rthdr = opt->srcrt;
410-
if (rthdr->type)
410+
switch (rthdr->type) {
411+
case IPV6_SRCRT_TYPE_0:
412+
#ifdef CONFIG_IPV6_MIP6
413+
case IPV6_SRCRT_TYPE_2:
414+
#endif
415+
break;
416+
default:
411417
goto sticky_done;
418+
}
419+
412420
if ((rthdr->hdrlen & 1) ||
413421
(rthdr->hdrlen >> 1) != rthdr->segments_left)
414422
goto sticky_done;

0 commit comments

Comments
 (0)