[packages] l2tpv3tun: support custom ifnames
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 8 Aug 2010 21:07:31 +0000 (21:07 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 8 Aug 2010 21:07:31 +0000 (21:07 +0000)
SVN-Revision: 22548

net/l2tpv3tun/Makefile
net/l2tpv3tun/patches/010-custom_ifname.patch [new file with mode: 0644]

index 568665b6a092f4eb7a0ab11eda19bfcf898d114a..36ad821c5d05a37e14bd15353f10fb434ffbb558 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=l2tpv3tun
 PKG_VERSION:=0.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=ftp://www.openl2tp.org/releases/
diff --git a/net/l2tpv3tun/patches/010-custom_ifname.patch b/net/l2tpv3tun/patches/010-custom_ifname.patch
new file mode 100644 (file)
index 0000000..14a085f
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/main.c
++++ b/main.c
+@@ -560,6 +560,7 @@ static void usage(void)
+       fprintf(stderr, "          session_id ID peer_session_id ID\n");
+       fprintf(stderr, "          [ cookie HEXSTR ] [ peer_cookie HEXSTR ]\n");
+       fprintf(stderr, "          [ offset OFFSET ] [ peer_offset OFFSET ]\n");
++      fprintf(stderr, "          [ ifname IFNAME ]\n");
+       fprintf(stderr, "       %s del tunnel tunnel_id ID\n", L2TP_CMD_ROOT);
+       fprintf(stderr, "       %s del session tunnel_id ID session_id ID\n", L2TP_CMD_ROOT);
+       fprintf(stderr, "       %s show tunnel [ tunnel_id ID ]\n", L2TP_CMD_ROOT);
+@@ -671,6 +672,9 @@ static int parse_args(int argc, char **a
+                       p->peer_cookie_len = slen / 2;
+                       if (hex2mem(*argv, p->peer_cookie, p->peer_cookie_len) < 0)
+                               invarg("cookie must be a hex string\n", *argv);
++              } else if (strcmp(*argv, "ifname") == 0) {
++                      NEXT_ARG();
++                      p->ifname = *argv;
+               } else if (strcmp(*argv, "tunnel") == 0) {
+                       p->tunnel = 1;
+               } else if (strcmp(*argv, "session") == 0) {