Skip to contentSkip to conversation

XFRM: Mobility header support.

PATCH In review Masahide NAKAMURA 2 participants 2 messages Dec 5, 2006

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

PATCH 7/7 XFRM: Mobility header support.

---
 ip/ipxfrm.c |    9 +++++++++
 ip/xfrm.h   |    3 +++
 2 files changed, 12 insertions(+), 0 deletions(-)
ip/ipxfrm.c +9 -0
index 7c9fd0b..9c8b4bd 100644
@@ -483,6 +483,14 @@ void xfrm_selector_print(struct xfrm_sel
 		if (sel->dport_mask)
 			fprintf(fp, "code %u ", ntohs(sel->dport));
 		break;
+	case IPPROTO_MH:
+		if (sel->sport_mask)
+			fprintf(fp, "type %u ", ntohs(sel->sport));
+		if (sel->dport_mask) {
+			if (show_stats > 0)
+				fprintf(fp, "(dport) 0x%.4x ", sel->dport);
+		}
+		break;
 	}
 
 	if (sel->ifindex > 0) {
@@ -1111,6 +1119,7 @@ static int xfrm_selector_upspec_parse(st
 		switch (sel->proto) {
 		case IPPROTO_ICMP:
 		case IPPROTO_ICMPV6:
+		case IPPROTO_MH:
 			break;
 		default:
 			fprintf(stderr, "\"type\" and \"code\" are invalid with proto=%s\n", strxf_proto(sel->proto));
ip/xfrm.h +3 -0
index d33ff94..03db37b 100644
@@ -35,6 +35,9 @@ #endif
 #ifndef IPPPROTO_DCCP
 # define IPPROTO_DCCP	33
 #endif
+#ifndef IPPROTO_MH
+# define IPPROTO_MH	135
+#endif
 
 #define XFRMS_RTA(x)  ((struct rtattr*)(((char*)(x)) + NLMSG_ALIGN(sizeof(struct xfrm_usersa_info))))
 #define XFRMS_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct xfrm_usersa_info))
Signature · 1 line
1.4.2