diff options
author | Andrew Savchenko <bircoph@gmail.com> | 2010-11-10 20:38:47 +0300 |
---|---|---|
committer | Andrew Savchenko <bircoph@gmail.com> | 2010-11-10 20:38:47 +0300 |
commit | 9166b1667dede66f109e5edf348d78ceacd680cb (patch) | |
tree | fb3ddc4734a5922ea7588c81e08f2e938c5fd121 /net-dialup/openl2tp | |
parent | openl2tpd: fix pppd auth args (diff) | |
download | bircoph-9166b1667dede66f109e5edf348d78ceacd680cb.tar.gz bircoph-9166b1667dede66f109e5edf348d78ceacd680cb.tar.bz2 bircoph-9166b1667dede66f109e5edf348d78ceacd680cb.zip |
openl2tpd: r1 ready
Add host name resolution capability to configuration subsystem.
Diffstat (limited to 'net-dialup/openl2tp')
-rw-r--r-- | net-dialup/openl2tp/ChangeLog | 10 | ||||
-rw-r--r-- | net-dialup/openl2tp/Manifest | 7 | ||||
-rw-r--r-- | net-dialup/openl2tp/files/openl2tp-1.7-resolveip.patch | 158 | ||||
-rw-r--r-- | net-dialup/openl2tp/files/openl2tpd.conf.sample | 2 | ||||
-rw-r--r-- | net-dialup/openl2tp/openl2tp-1.7-r1.ebuild | 2 |
5 files changed, 175 insertions, 4 deletions
diff --git a/net-dialup/openl2tp/ChangeLog b/net-dialup/openl2tp/ChangeLog index 7e10cf4..a78dd4a 100644 --- a/net-dialup/openl2tp/ChangeLog +++ b/net-dialup/openl2tp/ChangeLog @@ -2,6 +2,16 @@ # Copyright 2000-2010 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ +*openl2tp-1.7-r1.ebuild (10 Nov 2010) + + 10 Nov 2010; Andrew Savchenko <bircoph@gmail.com> + files/openl2tpd.conf.sample: + Update sample config file for hostname example. + + 10 Nov 2010; Andrew Savchenko <bircoph@gmail.com> + +files/openl2tp-1.7-resolveip.patch: + Allow to use host names instead of ipaddresses. + 10 Nov 2010; Andrew Savchenko <bircoph@gmail.com> +files/openl2tp-1.7-ppp_auth_args.patch: Apply upstream patch to fix ppp auth args passing. diff --git a/net-dialup/openl2tp/Manifest b/net-dialup/openl2tp/Manifest index 8e45f00..5239fd4 100644 --- a/net-dialup/openl2tp/Manifest +++ b/net-dialup/openl2tp/Manifest @@ -3,12 +3,13 @@ AUX openl2tp-1.7-ldflags.patch 2318 RMD160 32b38b8dbf8b0e29855b6571f261ca6c42c76 AUX openl2tp-1.7-man.patch 1345 RMD160 4103470fbaaebba1cfa232aaaf2a042b77e61e7f SHA1 4f1a05616a3f4faf4cc75ff5e2a64e4329cf1d15 SHA256 6752ee913ca7fae689408da9bc1148dd302cc5a97a18c7c0b9280d12e9f933c3 AUX openl2tp-1.7-ppp_auth_args.patch 5002 RMD160 60e6edece7c3a1e9b6d7568b2756f8d5baab720d SHA1 8bc053573075e80dc039dc4fa81b9cfb5db5fd64 SHA256 fc8e52d9bd35c9d4224f7fd46fa19ffe03f27f0f9d5404d1f9d913c1069d5ffd AUX openl2tp-1.7-pppd.patch 847 RMD160 734323993b668fe510ebbde78c1d04f2224be208 SHA1 731aaddf60cfc6cd9162221fb2ade4307e49fe3c SHA256 0a2c32f5f14ed6376557c810010afa2a29f88fc7445afc6fc03b5abea0b25482 +AUX openl2tp-1.7-resolveip.patch 5633 RMD160 30b6ea882db4feca37f503a8c2cc87d2978314d2 SHA1 1595dc4752c63710c38420fd13d804acb2ac7d48 SHA256 af0636e00e5dfbd04ba93acbed583541c77ce61b0aced6946fd7cc9674db5b39 AUX openl2tp-1.7-werror.patch 1602 RMD160 77c73e8d5bb89e1d1288e79db80339f0b42eeae8 SHA1 c4915b6f30dc43881a51d4ce5b8d61519429b18f SHA256 259d0291bfa64d4b33c77f2bf534006202259d4ec1105af8a9d1d857eebca1a7 -AUX openl2tpd.conf.sample 681 RMD160 c36361ea26c675263d90673933c32e1cd5664f38 SHA1 fe9022987dc009794b92577e58d2cf25b1e23f43 SHA256 333d2f4b4babf2a408d7ea7602871712d8a8337d9cd1bf885bc1b6e49b34528f +AUX openl2tpd.conf.sample 678 RMD160 34f2e81c2e1f810041eebf6859fb661105643428 SHA1 540606a185775d86137faff790bc54b905a297e0 SHA256 8f6b6bd8150b2275e3b0886fbe38fe79dc83870fc6d6ae848bdebda42e70d4a4 AUX openl2tpd.confd 627 RMD160 c98ef7bdcca067cab855b43f4c28d7db5651dbee SHA1 ab72ca17e0f3b1d8839bc1a644c11f160529bc9d SHA256 9bea610cf2614bdd6c2f371987f98f8c9b854dd8332d33647505c895ae9a7314 AUX openl2tpd.initd 1408 RMD160 38cbf38472df1a1493bc2be0cf8c55b17c8f1510 SHA1 76891770505f8927b1df0ead0648f3b5861e5da7 SHA256 946a0e8b7341e2d346b9b4814a3b1ed8519ee9b6db9bf0e91f7c7cabbf1f2c48 DIST openl2tp-1.7.tar.gz 501698 RMD160 5a85297060338fc24230582fc3674638d1778634 SHA1 f79e5229b8501664e98bac8229a6d8547b43467b SHA256 f6ae19e19340144ba28c31c55f4667fb180b61ee76ccef2bf63fa62f297ca9da -EBUILD openl2tp-1.7-r1.ebuild 4199 RMD160 0ded02ee0bacd2cb4066cd2e94098ca9478fcd92 SHA1 72ce525c15515501d1c42713c2d5f7d56e3e9293 SHA256 d5bb3d35647cd46088dc0e38510456bcd5c7d49b901953fbdd870e07a7d40a99 +EBUILD openl2tp-1.7-r1.ebuild 4286 RMD160 dd7460080b19917b0f064b5f1242098edc621391 SHA1 d4a91ae352b5ee8e65aed13b94f0cd3372107196 SHA256 57af340b38c7f7681af04a508ecae7199034452c7e2c5aabef5e91dc55e02bf8 EBUILD openl2tp-1.7.ebuild 4023 RMD160 2cda1a5a433446f75057727a5152660fa07b8144 SHA1 367b57a117e106d4eefb657450ca1788c88a9b6b SHA256 ff06cb9413037def2eb2f81e63bb31d92827ca643c2f8e3d460e1d198610eda8 -MISC ChangeLog 641 RMD160 d948c5d67f65389c3000e043132fff182434bd88 SHA1 22eb2d934c05b77ac61381c380882dbd8bb15d3c SHA256 5080caad454250c8b8fd5f1575fcbaa5783d91a505ff8f947151ea530a497a65 +MISC ChangeLog 956 RMD160 2c699ecfb830e56e88542b3053e4290d921d175b SHA1 57fed621593f8a09f34c9680a6db8485ed8b66da SHA256 12cfc10fb8893f81e994e51018b49b21c613de593004099d5707df695db904b5 MISC metadata.xml 762 RMD160 416cd2087fe041e02046f07bb6c1677908542c37 SHA1 302dc937814f7d4c32ad16c0300020794f519c0e SHA256 e765957111816f91553fd3db2fef165babdd02ee82d923da6f5b455b684afd72 diff --git a/net-dialup/openl2tp/files/openl2tp-1.7-resolveip.patch b/net-dialup/openl2tp/files/openl2tp-1.7-resolveip.patch new file mode 100644 index 0000000..2187882 --- /dev/null +++ b/net-dialup/openl2tp/files/openl2tp-1.7-resolveip.patch @@ -0,0 +1,158 @@ +diff -Naur openl2tp-1.7.base/Makefile openl2tp-1.7/Makefile +--- openl2tp-1.7.base/Makefile 2010-11-10 19:12:31.000000000 +0300 ++++ openl2tp-1.7/Makefile 2010-11-10 20:15:09.916132583 +0300 +@@ -103,6 +103,10 @@ + l2tp_network.c l2tp_tunnel.c l2tp_peer.c l2tp_transport.c \ + l2tp_session.c l2tp_ppp.c \ + l2tp_plugin.c l2tp_event.c l2tp_test.c md5.c ++ ++ifeq ($(L2TP_FEATURE_LOCAL_CONF_FILE),y) ++L2TPD_SRCS.c+= cli/cli_util.c ++endif + ifeq ($(L2TP_FEATURE_RPC_MANAGEMENT),y) + L2TPD_SRCS.c+= l2tp_api.c + endif +diff -Naur openl2tp-1.7.base/cli/Makefile openl2tp-1.7/cli/Makefile +--- openl2tp-1.7.base/cli/Makefile 2010-11-10 19:12:31.000000000 +0300 ++++ openl2tp-1.7/cli/Makefile 2010-11-10 20:03:51.870627874 +0300 +@@ -1,4 +1,4 @@ +-CLI_SRCS.c= cli_lib.c cli_readline.c ++CLI_SRCS.c= cli_lib.c cli_readline.c cli_util.c + CLI_SRCS.h= cli_api.h cli_private.h + CLI_SRCS_TEST.c= cli_test.c + +diff -Naur openl2tp-1.7.base/cli/cli_lib.c openl2tp-1.7/cli/cli_lib.c +--- openl2tp-1.7.base/cli/cli_lib.c 2008-05-08 00:44:20.000000000 +0400 ++++ openl2tp-1.7/cli/cli_lib.c 2010-11-10 20:05:20.876911771 +0300 +@@ -19,9 +19,6 @@ + *****************************************************************************/ + + #include <stdio.h> +-#include <sys/socket.h> +-#include <netinet/in.h> +-#include <arpa/inet.h> + #include <asm/types.h> + + #include <readline/readline.h> +@@ -29,6 +26,7 @@ + + #include "cli_api.h" + #include "cli_private.h" ++#include "cli_util.h" + + + static struct cli_node *cli_nodes; +@@ -652,7 +650,7 @@ + struct in_addr *ip = result; + int ret = 0; + +- ret = inet_aton(val, ip); ++ ret = cli_resolveip(val, ip); + if (ret != 1) { + ret = -EINVAL; + } else { +diff -Naur openl2tp-1.7.base/cli/cli_util.c openl2tp-1.7/cli/cli_util.c +--- openl2tp-1.7.base/cli/cli_util.c 1970-01-01 03:00:00.000000000 +0300 ++++ openl2tp-1.7/cli/cli_util.c 2010-11-10 20:09:08.158552473 +0300 +@@ -0,0 +1,45 @@ ++/***************************************************************************** ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free ++ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301 USA ++ * ++ *****************************************************************************/ ++ ++#include <stdio.h> ++#include <sys/types.h> ++#include <sys/socket.h> ++#include <netdb.h> ++ ++/* Resolve hostname or ipaddr into struct in_addr. ++ * Returns 1 on success, 0 on failure. */ ++int cli_resolveip(const char *val, struct in_addr *ip) ++{ ++ int code; ++ struct addrinfo *res; ++ ++ code = getaddrinfo(val, NULL, NULL, &res); ++ if (code) { ++ printf("Failed to resolve address '%s': %s\n", val, gai_strerror(code)); ++ return 0; ++ } ++ ++ // use the first ip address available, ++ // save it inside provided in_addr structure. ++ ip->s_addr = ((struct sockaddr_in*)(res->ai_addr))->sin_addr.s_addr; ++ ++ freeaddrinfo(res); ++ return 1; ++} ++ +diff -Naur openl2tp-1.7.base/cli/cli_util.h openl2tp-1.7/cli/cli_util.h +--- openl2tp-1.7.base/cli/cli_util.h 1970-01-01 03:00:00.000000000 +0300 ++++ openl2tp-1.7/cli/cli_util.h 2010-11-10 20:07:47.304346301 +0300 +@@ -0,0 +1,22 @@ ++/***************************************************************************** ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free ++ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301 USA ++ * ++ *****************************************************************************/ ++ ++/* Resolve hostname or ipaddr into struct in_addr. ++ * Returns 1 on success, 0 on failure. */ ++int cli_resolveip(const char *val, struct in_addr *ip); +diff -Naur openl2tp-1.7.base/l2tp_config_token.l openl2tp-1.7/l2tp_config_token.l +--- openl2tp-1.7.base/l2tp_config_token.l 2010-03-10 17:18:51.000000000 +0300 ++++ openl2tp-1.7/l2tp_config_token.l 2010-11-10 20:19:08.985957657 +0300 +@@ -2,9 +2,7 @@ + + #include <sys/types.h> + #include <sys/param.h> +-#include <sys/socket.h> + #include <netinet/in.h> +-#include <arpa/inet.h> + #include <stdlib.h> + #include <limits.h> + #include <string.h> +@@ -14,6 +12,7 @@ + + #include "l2tp_config_types.h" + #include "l2tp_config_parse.h" ++#include "cli/cli_util.h" + + void yyfatal(const char *s); + void yyerror(const char *s); +@@ -273,7 +272,7 @@ + + {ipaddress} { + struct in_addr addr; +- if (!inet_aton(yytext, &addr)) ++ if (!cli_resolveip(yytext, &addr)) + yyfatal("invalid IP address"); + yylval.ulnum = ntohl(addr.s_addr); + return(IPADDRESS); diff --git a/net-dialup/openl2tp/files/openl2tpd.conf.sample b/net-dialup/openl2tp/files/openl2tpd.conf.sample index a5da195..6ead75a 100644 --- a/net-dialup/openl2tp/files/openl2tpd.conf.sample +++ b/net-dialup/openl2tp/files/openl2tpd.conf.sample @@ -19,7 +19,7 @@ ppp profile modify \ tunnel create \ tunnel_name=campus \ - dest_ipaddr=my_l2tp_provider_ip \ + dest_ipaddr=my.l2tp.provider \ use_udp_checksums=off \ persist=yes diff --git a/net-dialup/openl2tp/openl2tp-1.7-r1.ebuild b/net-dialup/openl2tp/openl2tp-1.7-r1.ebuild index c33b3ea..c2a065e 100644 --- a/net-dialup/openl2tp/openl2tp-1.7-r1.ebuild +++ b/net-dialup/openl2tp/openl2tp-1.7-r1.ebuild @@ -64,6 +64,8 @@ src_prepare() { # apply upstream patch for pppd auth args fix: # ftp://ftp.openl2tp.org/releases/openl2tp-1.7/openl2tp-fix_ppp_auth_args.patch epatch "${FILESDIR}/${P}-ppp_auth_args.patch" + # add support for host names in the config + epatch "${FILESDIR}/${P}-resolveip.patch" } src_configure() { |