[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(usagi-users 02993) Re: tool ip and xfrm



Hello.

In article <40FEAC30.7020802@xxxxxxxxx> (at Wed, 21 Jul 2004 19:47:28 +0200), jean-mickael guerin <jean-mickael.guerin@xxxxxxxxx> says:

> On building tool 'ip' from usagi-linux24-s20040719.tar.bz2 I faced many 
> errors related to xfrm.

Thanks for the report. 
Please try the following patch.

Thanks.

Index: src/iproute2/ip/ipxfrm.c
===================================================================
RCS file: /cvsroot/usagi/usagi/src/iproute2/ip/ipxfrm.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- src/iproute2/ip/ipxfrm.c	8 Jul 2004 10:10:00 -0000	1.2
+++ src/iproute2/ip/ipxfrm.c	21 Jul 2004 19:35:34 -0000	1.3
@@ -1,4 +1,4 @@
-/* $USAGI: ipxfrm.c,v 1.2 2004/07/08 10:10:00 nakam Exp $ */
+/* $USAGI: ipxfrm.c,v 1.3 2004/07/21 19:35:34 yoshfuji Exp $ */
 
 /*
  * Copyright (C)2004 USAGI/WIDE Project
@@ -33,6 +33,7 @@
 #include <time.h>
 #include <netdb.h>
 #include <net/if.h>
+#include <linux/types.h>
 #include <linux/netlink.h>
 #include <linux/rtnetlink.h>
 #include <linux/xfrm.h>
Index: src/iproute2/ip/xfrm_policy.c
===================================================================
RCS file: /cvsroot/usagi/usagi/src/iproute2/ip/xfrm_policy.c,v
retrieving revision 1.1
retrieving revision 1.3
diff -u -r1.1 -r1.3
--- src/iproute2/ip/xfrm_policy.c	8 Jul 2004 09:55:17 -0000	1.1
+++ src/iproute2/ip/xfrm_policy.c	21 Jul 2004 20:03:45 -0000	1.3
@@ -1,4 +1,4 @@
-/* $USAGI: xfrm_policy.c,v 1.1 2004/07/08 09:55:17 nakam Exp $ */
+/* $USAGI: xfrm_policy.c,v 1.3 2004/07/21 20:03:45 yoshfuji Exp $ */
 
 /*
  * Copyright (C)2004 USAGI/WIDE Project
@@ -29,6 +29,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <netdb.h>
+#include <linux/types.h>
 #include <linux/netlink.h>
 #include <linux/xfrm.h>
 #include "utils.h"
@@ -160,6 +161,7 @@
 
 static int xfrm_policy_modify(int cmd, unsigned flags, int argc, char **argv)
 {
+#ifdef NETLINK_XFRM
 	struct rtnl_handle rth;
 	struct {
 		struct nlmsghdr			n;
@@ -274,6 +276,9 @@
 	rtnl_close(&rth);
 
 	return 0;
+#else
+	exit(1);
+#endif
 }
 
 static int xfrm_policy_filter_match(struct xfrm_userpolicy_info *xpinfo)
@@ -385,6 +390,7 @@
 static int xfrm_policy_get_or_delete(int argc, char **argv, int delete,
 				     void *res_nlbuf)
 {
+#ifdef NETLINK_XFRM
 	struct rtnl_handle rth;
 	struct {
 		struct nlmsghdr			n;
@@ -457,6 +463,9 @@
 	rtnl_close(&rth);
 
 	return 0;
+#else
+	exit(1);
+#endif
 }
 
 static int xfrm_policy_delete(int argc, char **argv)
@@ -533,6 +542,7 @@
 
 static int xfrm_policy_list_or_flush(int argc, char **argv, int flush)
 {
+#ifdef NETLINK_XFRM
 	struct rtnl_handle rth;
 
 	if (argc > 0)
@@ -642,6 +652,9 @@
 	rtnl_close(&rth);
 
 	exit(0);
+#else
+	exit(1);
+#endif
 }
 
 int do_xfrm_policy(int argc, char **argv)
Index: src/iproute2/ip/xfrm_state.c
===================================================================
RCS file: /cvsroot/usagi/usagi/src/iproute2/ip/xfrm_state.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- src/iproute2/ip/xfrm_state.c	8 Jul 2004 09:55:17 -0000	1.1
+++ src/iproute2/ip/xfrm_state.c	21 Jul 2004 20:03:45 -0000	1.2
@@ -1,4 +1,4 @@
-/* $USAGI: xfrm_state.c,v 1.1 2004/07/08 09:55:17 nakam Exp $ */
+/* $USAGI: xfrm_state.c,v 1.2 2004/07/21 20:03:45 yoshfuji Exp $ */
 
 /*
  * Copyright (C)2004 USAGI/WIDE Project
@@ -158,6 +158,7 @@
 
 static int xfrm_state_modify(int cmd, unsigned flags, int argc, char **argv)
 {
+#ifdef NETLINK_XFRM
 	struct rtnl_handle rth;
 	struct {
 		struct nlmsghdr 	n;
@@ -294,6 +295,9 @@
 	rtnl_close(&rth);
 
 	return 0;
+#else
+	return -1;
+#endif
 }
 
 static int xfrm_state_filter_match(struct xfrm_usersa_info *xsinfo)
@@ -386,6 +390,7 @@
 
 static int xfrm_state_get_or_delete(int argc, char **argv, int delete)
 {
+#ifdef NETLINK_XFRM
 	struct rtnl_handle rth;
 	struct {
 		struct nlmsghdr 	n;
@@ -452,6 +457,9 @@
 	rtnl_close(&rth);
 
 	return 0;
+#else
+	return -1;
+#endif
 }
 
 /*
@@ -507,6 +515,7 @@
 
 static int xfrm_state_list_or_flush(int argc, char **argv, int flush)
 {
+#ifdef NETLINK_XFRM
 	char *idp = NULL;
 	struct rtnl_handle rth;
 
@@ -607,6 +616,9 @@
 	rtnl_close(&rth);
 
 	exit(0);
+#else
+	exit(1);
+#endif
 }
 
 int do_xfrm_state(int argc, char **argv)

--yoshfuji