Skip to contentSkip to conversation

MIP6: Add socket option and ancillary data interface of routing header type 2.

PATCH In review Masahide NAKAMURA 1 participant 1 message Jul 29, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 5/20 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.

---
 net/ipv6/datagram.c      |   11 +++++++----
 net/ipv6/ipv6_sockglue.c |   10 +++++++++-
 2 files changed, 16 insertions(+), 5 deletions(-)
net/ipv6/datagram.c +7 -4
index 99a6eb2..063a74e 100644
@@ -641,10 +641,13 @@ int datagram_send_ctl(struct msghdr *msg
 
 			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;
 			}
net/ipv6/ipv6_sockglue.c +9 -1
index 4c20eeb..68c1512 100644
@@ -304,8 +304,16 @@ static int do_ipv6_setsockopt(struct soc
 		/* 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;
Signature · 1 line
1.4.1