Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 195461 - ebuild request: openl2tp
Summary: ebuild request: openl2tp
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement with 3 votes (vote)
Assignee: Andrew Savchenko
URL: http://sourceforge.net/projects/openl...
Whiteboard:
Keywords: EBUILD
Depends on: 650852
Blocks:
  Show dependency tree
 
Reported: 2007-10-11 05:07 UTC by Jaco Kroon
Modified: 2018-07-03 18:59 UTC (History)
12 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
openl2tp-0.19.ebuild (openl2tp-0.19.ebuild,430 bytes, text/plain)
2008-01-22 20:34 UTC, Jaco Kroon
Details
openl2tp-0.19.ebuild (openl2tp-0.19.ebuild,819 bytes, text/plain)
2008-01-22 21:42 UTC, Jaco Kroon
Details
ebuild version update (openl2tp-1.4.ebuild,997 bytes, text/plain)
2008-07-10 21:02 UTC, Михаил
Details
init script (openl2tp.initd,833 bytes, text/plain)
2008-07-10 21:04 UTC, Михаил
Details
init script (openl2tp.initd,992 bytes, text/plain)
2008-07-30 14:37 UTC, Михаил
Details
openl2tp-1.7.ebuild (openl2tp-1.7.ebuild,3.33 KB, text/plain)
2010-07-31 18:07 UTC, Andrew Savchenko
Details
metadata.xml (metadata.xml,668 bytes, text/plain)
2010-07-31 18:08 UTC, Andrew Savchenko
Details
openl2tp-1.7-werror.patch (openl2tp-1.7-werror.patch,1.56 KB, patch)
2010-07-31 18:09 UTC, Andrew Savchenko
Details | Diff
openl2tp-1.7-ldflags.patch (openl2tp-1.7-ldflags.patch,2.26 KB, patch)
2010-07-31 18:10 UTC, Andrew Savchenko
Details | Diff
openl2tp-1.7-pppd.patch (openl2tp-1.7-pppd.patch,847 bytes, patch)
2010-07-31 18:11 UTC, Andrew Savchenko
Details | Diff
openl2tp-1.7-man.patch (openl2tp-1.7-man.patch,1.31 KB, patch)
2010-07-31 18:11 UTC, Andrew Savchenko
Details | Diff
init.d daemon script (openl2tpd.initd,738 bytes, text/plain)
2010-07-31 18:12 UTC, Andrew Savchenko
Details
conf.d configuration file (openl2tpd.confd,560 bytes, text/plain)
2010-07-31 18:12 UTC, Andrew Savchenko
Details
use ipsec daemons if they are available (openl2tpd.initd,759 bytes, text/plain)
2010-08-06 20:04 UTC, Andrew Savchenko
Details
make multiple warning messages a bit more readable (openl2tp-1.7.ebuild,3.36 KB, text/plain)
2010-08-06 20:04 UTC, Andrew Savchenko
Details
openl2tp-1.7.ebuild (openl2tp-1.7.ebuild,3.92 KB, text/plain)
2010-09-05 09:45 UTC, Andrew Savchenko
Details
l2tpconfig patch (openl2tp-1.7-l2tpconfig.patch,621 bytes, patch)
2010-09-05 09:47 UTC, Andrew Savchenko
Details | Diff
sample config file (openl2tpd.conf.sample,622 bytes, text/plain)
2010-09-05 09:48 UTC, Andrew Savchenko
Details
new conf.d version (openl2tpd.confd,627 bytes, text/plain)
2010-09-05 09:50 UTC, Andrew Savchenko
Details
openl2tpd init script (openl2tpd.initd,1.20 KB, text/plain)
2010-09-05 09:51 UTC, Andrew Savchenko
Details
openl2tpd init script (openl2tpd.initd,1.26 KB, text/plain)
2010-09-05 10:44 UTC, Andrew Savchenko
Details
openl2tpd init script (openl2tpd.initd,1.22 KB, text/plain)
2010-09-05 11:16 UTC, Andrew Savchenko
Details
openl2tpd init script (openl2tpd.initd,1.29 KB, text/plain)
2010-09-09 19:41 UTC, Andrew Savchenko
Details
openl2tp-1.7-man.patch (openl2tp-1.7-man.patch,1.31 KB, patch)
2010-09-09 19:43 UTC, Andrew Savchenko
Details | Diff
openl2tpd init script (openl2tpd.initd,1.29 KB, text/plain)
2010-10-06 16:09 UTC, Andrew Savchenko
Details
openl2tpd init script (openl2tpd.initd,1.29 KB, text/plain)
2010-10-06 16:17 UTC, Andrew Savchenko
Details
openl2tp-1.7.ebuild (openl2tp-1.7.ebuild,3.93 KB, text/plain)
2010-10-06 18:51 UTC, Andrew Savchenko
Details
openl2tpd init script (openl2tpd.initd,1.38 KB, text/plain)
2010-10-17 20:57 UTC, Andrew Savchenko
Details
openl2tp-1.8.ebuild (openl2tp-1.8.ebuild,3.29 KB, application/octet-stream)
2011-06-03 17:31 UTC, Jaco Kroon
Details
openl2tp-1.8-werror.patch (openl2tp-1.8-werror.patch,1.41 KB, patch)
2011-06-03 17:32 UTC, Jaco Kroon
Details | Diff
openl2tp-1.8-pppd.patch (openl2tp-1.8-pppd.patch,485 bytes, patch)
2011-06-03 17:32 UTC, Jaco Kroon
Details | Diff
openl2tp-1.8-parallelbuild.patch (openl2tp-1.8-parallelbuild.patch,841 bytes, patch)
2011-06-03 17:33 UTC, Jaco Kroon
Details | Diff
openl2tp-1.8-man.patch (openl2tp-1.8-man.patch,1.27 KB, patch)
2011-06-03 17:33 UTC, Jaco Kroon
Details | Diff
openl2tp-1.8-ldflags.patch (openl2tp-1.8-ldflags.patch,2.17 KB, patch)
2011-06-03 17:34 UTC, Jaco Kroon
Details | Diff
openl2tp-1.8-l2tpconfig.patch (openl2tp-1.8-l2tpconfig.patch,614 bytes, patch)
2011-06-03 17:35 UTC, Jaco Kroon
Details | Diff
net-dialup_openl2tp.tgz (net-dialup_openl2tp.tgz,6.50 KB, application/x-gtar)
2011-06-03 17:36 UTC, Jaco Kroon
Details
openl2tp-1.8-optionsfile.patch (openl2tp-1.8-optionsfile.patch,10.03 KB, patch)
2011-06-04 15:14 UTC, Jaco Kroon
Details | Diff
openl2tp-1.8.ebuild (openl2tp-1.8.ebuild,3.43 KB, application/octet-stream)
2011-06-04 15:16 UTC, Jaco Kroon
Details
net-dialup_openl2tp.tgz (net-dialup_openl2tp.tgz,9.37 KB, application/x-gtar)
2011-06-04 15:18 UTC, Jaco Kroon
Details
openl2tp-1.8-clientip_as_ipparam.patch (openl2tp-1.8-clientip_as_ipparam.patch,8.44 KB, patch)
2011-06-04 20:51 UTC, Jaco Kroon
Details | Diff
openl2tp-1.8.ebuild (openl2tp-1.8.ebuild,3.51 KB, application/octet-stream)
2011-06-04 21:26 UTC, Jaco Kroon
Details
net-dialup_openl2tp.tgz (net-dialup_openl2tp.tgz,10.75 KB, application/x-gtar)
2011-06-04 21:32 UTC, Jaco Kroon
Details
openl2tp-1.8-setkey.patch (openl2tp-1.8-setkey.patch,483 bytes, patch)
2011-06-05 09:51 UTC, Jaco Kroon
Details | Diff
openl2tp-1.8.ebuild (openl2tp-1.8.ebuild,3.60 KB, application/octet-stream)
2011-06-05 09:52 UTC, Jaco Kroon
Details
net-dialup_openl2tp.tgz (net-dialup_openl2tp.tgz,11.03 KB, application/x-gtar)
2011-06-05 09:55 UTC, Jaco Kroon
Details
openl2tp-snapshot.tar.xz (openl2tp-snapshot.tar.xz,11.71 KB, application/x-xz)
2011-06-10 05:35 UTC, Andrew Savchenko
Details
net-dialup/openl2p prepared patch for portage (0001-net-dialup-openl2tp-new-ebuild-v-1.8.patch,40.29 KB, patch)
2016-09-20 14:11 UTC, Jaco Kroon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaco Kroon 2007-10-11 05:07:51 UTC
I'm looking for an ebuild for openl2tp ... I may get time a little later to write one, but in the meantime if somebody is bored, please go ahead (just let me know that you're writing it so we don't duplicate effort).

Reproducible: Always

Steps to Reproduce:
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-10-11 07:56:27 UTC
Maybe you could at least post some description of the thing... :)
Comment 2 Jaco Kroon 2007-10-11 08:58:39 UTC
It's a kernel-based implementation of the L2TP protocol.  The kernel part has to the best of my knowledge been merged into the mainline kernel at version 2.6.23, and this is the userland tools required to make it work.
Comment 3 Jaco Kroon 2008-01-22 20:34:50 UTC
Created attachment 141597 [details]
openl2tp-0.19.ebuild

Very simple ebuild for merging openl2tp, default config only, it's probably possible to add various options to make, if anybody is looking to flip specific features, I'd be willing to add those, for the moment I'm sticking with the philosophy of less is more, keep it simple, keep it stupid.
Comment 4 Jaco Kroon 2008-01-22 21:42:55 UTC
Created attachment 141602 [details]
openl2tp-0.19.ebuild

I must've been drinking something when I submitted the previous ebuild.  This one should work much better.
Comment 5 Михаил 2008-07-10 21:02:54 UTC
Created attachment 160077 [details]
ebuild version update
Comment 6 Михаил 2008-07-10 21:04:18 UTC
Created attachment 160079 [details]
init script
Comment 7 Михаил 2008-07-30 14:37:14 UTC
Created attachment 161722 [details]
init  script
Comment 8 Alexey Sychev 2010-02-26 17:20:51 UTC
Why this ebuild is not in portage three?
Comment 9 Alexey Sychev 2010-03-01 18:50:23 UTC
Anybody here? ;)
Comment 10 Andrew Savchenko gentoo-dev 2010-07-27 21:17:42 UTC
Yes, it rocks! and this is the only Linux l2tp client that supports pppol2tp kernel module.

Ping!
Comment 11 Andrew Savchenko gentoo-dev 2010-07-31 18:06:50 UTC
I reworked ebuild for version 1.7.

Now it supports additional USE flags for server/client functionality separation, rpc support is now optional, as well as pppd plugins and status files. Also I updated init.d and config.d files.

Currently I'm working using openl2tpd-1.7 and it really strikes after xl2tpd: ping delays are 20% lower, ftp downloads are 2-3 times faster. I tested it on ~x86 and ~amd64 with rather complicated CFLAGS and --as-needed in the LDFLAGS.

If someone will proxy me, I may support this package in the future.
Comment 12 Andrew Savchenko gentoo-dev 2010-07-31 18:07:53 UTC
Created attachment 240847 [details]
openl2tp-1.7.ebuild
Comment 13 Andrew Savchenko gentoo-dev 2010-07-31 18:08:55 UTC
Created attachment 240849 [details]
metadata.xml
Comment 14 Andrew Savchenko gentoo-dev 2010-07-31 18:09:49 UTC
Created attachment 240851 [details, diff]
openl2tp-1.7-werror.patch

Remove -Werror as even plain -O2 causes some warnings.
Comment 15 Andrew Savchenko gentoo-dev 2010-07-31 18:10:13 UTC
Created attachment 240853 [details, diff]
openl2tp-1.7-ldflags.patch

Use system LDFLAGS.
Comment 16 Andrew Savchenko gentoo-dev 2010-07-31 18:11:07 UTC
Created attachment 240855 [details, diff]
openl2tp-1.7-pppd.patch

Let the portage control whether pppd plugins should be build or not.
Comment 17 Andrew Savchenko gentoo-dev 2010-07-31 18:11:53 UTC
Created attachment 240857 [details, diff]
openl2tp-1.7-man.patch

Do not gzip manual pages, let portage compress them.
Comment 18 Andrew Savchenko gentoo-dev 2010-07-31 18:12:20 UTC
Created attachment 240859 [details]
init.d daemon script
Comment 19 Andrew Savchenko gentoo-dev 2010-07-31 18:12:35 UTC
Created attachment 240861 [details]
conf.d configuration file
Comment 20 Andrew Savchenko gentoo-dev 2010-07-31 18:15:07 UTC
Currently I tested it as a server only slightly and I'm using it as a client under a rather heavy load. Ipsec was not tested so far. More testing will be welcome.

Of course, additional control USE flags may be added to the ebuild, but they are of minor importance and at this moment I this current flags should be sufficient.
Comment 21 Andrew Savchenko gentoo-dev 2010-08-06 20:04:11 UTC
Created attachment 241675 [details]
use ipsec daemons if they are available

Either racoon or openswan may be used.
Comment 22 Andrew Savchenko gentoo-dev 2010-08-06 20:04:52 UTC
Created attachment 241677 [details]
make multiple warning messages a bit more readable
Comment 23 Kelly Price 2010-08-14 15:45:05 UTC
I'm interested in trying this out.  What is your layout of .../portage/net-misc/openl2tp?
Comment 24 Andrew Savchenko gentoo-dev 2010-09-04 21:22:43 UTC
My layout is net-dialup/openl2tp, I choose net-dialup because ppp does so.
Comment 25 Andrew Savchenko gentoo-dev 2010-09-05 09:37:41 UTC
Some new changes.

1) RPC security problem. Despite rpc control connection by default is accepted only from localhost, no auth checks are available, so any user may run l2tpconfig and establish new or change existent connections.

To minimize security impact l2tpconfig is now installed at /usr/sbin with 0500 access mode (for root only). Of course it is still possible for local users to copy binary from somewhere or compile it from source if this is not prohibited by system administrator.

Thus users are now warned about possible security risk when using USE="rpc" and this flag is forced by default no longer. However, it is harder to config daemon without l2tpconfig, so users have to choose.

2) Install sample config file to help new users to start with.

3) init.d script now tries to use l2tpconfig to load config file instead of -c openl2tpd command line option when rpc is enabled. This is required because reading from config have several bugs like problem with numerical user login, l2tpconfig seems to work ok here.

4) Update confd to clarify that default config file is not needed to be provided.
Comment 26 Andrew Savchenko gentoo-dev 2010-09-05 09:45:26 UTC
Created attachment 246100 [details]
openl2tp-1.7.ebuild

Contains updated RPC support and warnings, installs sample config file.
Comment 27 Andrew Savchenko gentoo-dev 2010-09-05 09:47:29 UTC
Created attachment 246102 [details, diff]
l2tpconfig patch

Install l2tpconfig to /usr/sbin with mode 0500 to make it at least a bit more secure.
Comment 28 Andrew Savchenko gentoo-dev 2010-09-05 09:48:20 UTC
Created attachment 246104 [details]
sample config file

Install sample config file to make it easier to config the daemon for new users.
Comment 29 Andrew Savchenko gentoo-dev 2010-09-05 09:50:02 UTC
Created attachment 246105 [details]
new conf.d version

This conf.d contains better comment about config file path.
Comment 30 Andrew Savchenko gentoo-dev 2010-09-05 09:51:18 UTC
Created attachment 246107 [details]
openl2tpd init script

Updated version of init script.
Now it tries to use l2tpconfig whenever possible.
Comment 31 Andrew Savchenko gentoo-dev 2010-09-05 10:44:31 UTC
Created attachment 246113 [details]
openl2tpd init script

Add sleep during restart, otherwise server may be too slow to drop old connection in time.
Comment 32 Andrew Savchenko gentoo-dev 2010-09-05 11:16:50 UTC
Created attachment 246114 [details]
openl2tpd init script

The real problem was that l2tpconfig may start before openl2tpd will complete its startup, so sleep a bit before l2tpconfig execution.
Comment 33 Andrew Savchenko gentoo-dev 2010-09-09 19:41:15 UTC
Created attachment 246624 [details]
openl2tpd init script

l2tp module name was changed in 2.6.35 from pppol2tp to lt2p_ppp (kernel config option and /proc interfaces are the same). Try to load both modules: newer first and older as fallback.
Comment 34 Andrew Savchenko gentoo-dev 2010-09-09 19:43:21 UTC
Created attachment 246625 [details, diff]
openl2tp-1.7-man.patch

Install l2tpconfig manual unconditionally, because in contains description of options required to write or change config file.
Comment 35 Andrew Savchenko gentoo-dev 2010-10-06 16:09:32 UTC
Created attachment 249763 [details]
openl2tpd init script

Fix a typo (userpc instead of $userpc).
Comment 36 Andrew Savchenko gentoo-dev 2010-10-06 16:17:30 UTC
Created attachment 249764 [details]
openl2tpd init script

Oops, uploaded wrong version of the fix.
Comment 37 Andrew Savchenko gentoo-dev 2010-10-06 18:51:01 UTC
Created attachment 249778 [details]
openl2tp-1.7.ebuild

Fix pppd version check.
Comment 38 Andrew Savchenko gentoo-dev 2010-10-17 20:57:16 UTC
Created attachment 251061 [details]
openl2tpd init script

Add a sleep between stop and start actions at restart, otherwise pppd is sometimes too slow to stop before new instance of pppd will be started.
Comment 39 Andrew Savchenko gentoo-dev 2010-10-25 11:20:35 UTC
Package is added to bircoph overlay.
Comment 40 Jaco Kroon 2011-06-03 15:33:17 UTC
Andrew!

Thanks for some excellent work.

I've just bumped it to 1.8 and cleaned up some of the patches.  They are all still required.

In particular the Makefile had some offsets and other changes patch didn't like so I applied all Makefile patches by hand and re-diffed.

I did however modify the man patch to not break the clean option (not that it'll ever be used).

I tried to be less intrusive as far as possible but honestly mostly the patches you provided were pretty clean to begin with.

I also bumped to EAPI=4 with checks for at least client or server USE flags there so emerge will fail during preperation stage instead of during pkg_config.  After discussion on #gentoo-dev-help the kernel version check was also removed, instead purely relying on the PPPOL2TP CONFIG_CHECK option which seems to do the trick.

I'll upload all the new files just now.
Comment 41 Jaco Kroon 2011-06-03 17:31:32 UTC
Created attachment 275687 [details]
openl2tp-1.8.ebuild

Right, so I ran into some build problems during final tests.  Parallel building ... and patched (hopefully complete).
Comment 42 Jaco Kroon 2011-06-03 17:32:17 UTC
Created attachment 275689 [details, diff]
openl2tp-1.8-werror.patch

werror patch still required.
Comment 43 Jaco Kroon 2011-06-03 17:32:48 UTC
Created attachment 275691 [details, diff]
openl2tp-1.8-pppd.patch
Comment 44 Jaco Kroon 2011-06-03 17:33:14 UTC
Created attachment 275693 [details, diff]
openl2tp-1.8-parallelbuild.patch
Comment 45 Jaco Kroon 2011-06-03 17:33:43 UTC
Created attachment 275695 [details, diff]
openl2tp-1.8-man.patch
Comment 46 Jaco Kroon 2011-06-03 17:34:39 UTC
Created attachment 275697 [details, diff]
openl2tp-1.8-ldflags.patch
Comment 47 Jaco Kroon 2011-06-03 17:35:11 UTC
Created attachment 275699 [details, diff]
openl2tp-1.8-l2tpconfig.patch
Comment 48 Jaco Kroon 2011-06-03 17:36:21 UTC
Created attachment 275701 [details]
net-dialup_openl2tp.tgz

tar.gz file containing all of the required files.

Andrew, again, thanks for doing all of the footwork on this.
Comment 49 Jaco Kroon 2011-06-04 15:14:34 UTC
Created attachment 275803 [details, diff]
openl2tp-1.8-optionsfile.patch
Comment 50 Jaco Kroon 2011-06-04 15:16:54 UTC
Created attachment 275805 [details]
openl2tp-1.8.ebuild

Incorporate the optionsfile patch, which adds an optionsfile configuration option to the ppp profile section to allow incorporating a custom options file instead of the default /etc/ppp/options.
Comment 51 Jaco Kroon 2011-06-04 15:18:00 UTC
Created attachment 275807 [details]
net-dialup_openl2tp.tgz

All nicely archived once more.
Comment 52 Jaco Kroon 2011-06-04 20:51:45 UTC
Created attachment 275845 [details, diff]
openl2tp-1.8-clientip_as_ipparam.patch

This patch enables openl2tp to pass the peer IP of the connecting client via ipparam to pppd.  This is similar to what pptpd does and allows the radius plugin to pass the Calling-Station-Id tag to radius.  This is useful for various purposes (my personal use is to just log the ip as part of my accounting records.
Comment 53 Jaco Kroon 2011-06-04 21:26:53 UTC
Created attachment 275847 [details]
openl2tp-1.8.ebuild

Updated ebuild to include the clientip_as_ipparam patch.
Comment 54 Jaco Kroon 2011-06-04 21:32:21 UTC
Created attachment 275851 [details]
net-dialup_openl2tp.tgz

Tar up again.

Sorry for the large amount of noise on this today.  I should be done now.  All my requirements are now met on this and my two patches has also been made available on the openl2tp forums:

http://forums.openl2tp.org/viewtopic.php?f=4&t=63
http://forums.openl2tp.org/viewtopic.php?f=4&t=64

Is it possible to push for this to be included in the main portage tree?
Comment 55 Jaco Kroon 2011-06-05 09:51:05 UTC
Created attachment 275861 [details, diff]
openl2tp-1.8-setkey.patch

The path for setkey in openl2tp is assumed to be /sbin/setkey and is hard-coded in the ipsec.so plugin.  This patch swaps one hardcoded path out for another and sets it to /usr/sbin/setkey as this is where Gentoo has it installed (at least for ipsec-tools).

I have not checked whether openswan uses the same path, if not I should probably submit a patch that uses one or the other as default, or that tries both locations, or makes it configurable.
Comment 56 Jaco Kroon 2011-06-05 09:52:40 UTC
Created attachment 275863 [details]
openl2tp-1.8.ebuild

Incorporate the setkey patch.
Comment 57 Jaco Kroon 2011-06-05 09:55:10 UTC
Created attachment 275865 [details]
net-dialup_openl2tp.tgz

and a tarred up version again.
Comment 58 Andrew Savchenko gentoo-dev 2011-06-05 14:11:08 UTC
Hello, Jaco!

Thanks for your update.

But I must note that you have done some superfluous work: ebuild update for a version 1.8 was made long time ago 8-). After several changes I put this package into public "bircoph" overlay (and noted this here), because it is too inconvenient to support this ebuild using bugzilla due to numerous patches to both developers and users, and some people asked me to create the overlay.

Concerning to your changes, I'll review them and sync my overlay with them in a few days.
Comment 59 Andrew Savchenko gentoo-dev 2011-06-10 05:35:58 UTC
Created attachment 276449 [details]
openl2tp-snapshot.tar.xz

OK, I have updated the overlay using your changes (and they are really good, I must admit). I upload a snapshot for your convenience.

The most important changes are:

1) init script is updated: 0.5 second delay before config load is not enough on some systems. 

On one of my servers it takes up to 10 seconds to run the daemon because of parallel openrc and single CPU core. Obviously, it is no good to wait that long, so more intelligent approach is used: a loop with small step delay and finite number of iterations.

Maybe a similar approach should be used for restart function, or it will be event better to wait until pppd finishes in the stop function. But for the moment I have seldom see problems with 1 sec sleep.

2) new USE="examples" and updated sample config file.

3) I removed cosmetics chunks from some patches.

4) Patches are applied using PATCHES array, this makes ebuild simpler and smaller.

5) QA fixes for variables quotation.

6) Improved ewarn to note that logins consisting only of digits must be embraced in double quotes.
Comment 60 Jaco Kroon 2011-06-10 07:42:52 UTC
Thanks!  Huge pleasure to be able to share those patches though.

Unfortunately for my needs I can't track your overlay, but I have duplicated the additional changes in our company overlay.  Is there any way you can set up a notification to me should you commit changes to that portion of your overlay?

Interesting approach on the loading of config via RPC.  Fortunately I could dodge that one.

I like your init script updates too.  Much more robust than the initial version, and it does use racoon :D.  Take it you're using one of the alternate ipsec implementations?  I'm still wondeding about that choice - got it working (as a server) but what a mission.  Doubt the patches I wrote for that will make it into mainline there though (to be able to have a default PSK should none of the others apply, would still like to enable a per-subnet based PSK but that looks like too much effort, and I don't need it right at the moment).

In the ebuild, your ewarn regarding the numerical strings will only display if the rpc USE flag is NOT set - which is probably not what you intended (I suggest moving to just above the if, with no leading blank ewarn - the guys in #gentoo-dev-help frowned upon those).
Comment 61 Andrew Savchenko gentoo-dev 2011-06-18 13:08:01 UTC
Hello,

(In reply to comment #60)
> Unfortunately for my needs I can't track your overlay, but I have duplicated
> the additional changes in our company overlay.  Is there any way you can set up
> a notification to me should you commit changes to that portion of your overlay?

I though of this a long time ago, but this is where git is superseded by svn: in git you can't easily import an arbitrary subdirectory of a project. I see two possible solutions: either to create a separate git repository and include it as a submodule in the overlay or to write some hook for git postcommit with e-mail notification. The first way anyone will be able to use only openl2tp package without a need to use whole overlay, but this will create too much maintainance burden to me, and keeping an overlay in order will be a pain.

I am considering now a hook script, if I will succeed, I may add your e-mail to a notification list, if you want.

> Interesting approach on the loading of config via RPC.  Fortunately I could
> dodge that one.

That's a measure out of necessity, see below about numerical strings.
 
> I like your init script updates too.  Much more robust than the initial
> version, and it does use racoon :D.  Take it you're using one of the alternate
> ipsec implementations?

Currently I do not use ipsec at all on my setup. I used it for testing, but due to current network conditions this will add a little security. Also bandwidth is more important for now.

> In the ebuild, your ewarn regarding the numerical strings will only display if
> the rpc USE flag is NOT set - which is probably not what you intended (I
> suggest moving to just above the if, with no leading blank ewarn - the guys in
> #gentoo-dev-help frowned upon those).

But this is exactly what I want. There is one uncommon thing about openl2tp, perhaps this is why gentoo developers were in a lapse: it has two absolutely separate config file readers: l2tpconfig parser and openl2tpd bison-based parser. The former is reliable, fully functional and have no problems with config file, but requires RPC support and some additional actions in the script to load config after openl2tpd was started. The latter does not require l2tpconfig and RPC support, but is buggy (and was hellishly buggy before 1.8), especially with numeric logins or special characters here and there. 

That is exactly why I use l2tpconfig in the init script whenever possible to load daemon's config file, even though this makes initd more complicated. You can read more details at this discussion: http://forums.openl2tp.org/viewtopic.php?f=3&t=26&start=0&st=0&sk=t&sd=a&hilit=bison
And this is exactly why users should be warned about a bug only if they are NOT using RPC.
Comment 62 Andrew Savchenko gentoo-dev 2012-03-11 22:19:43 UTC
I've update ebuild to openl2tpd-1.8-r5.

This fixes restart delay (needed for ppp connection to close before new connections are open). Also warning from newer openrc versions is fixed.

You can found ebuild in my overlay.
Comment 63 Tony Vroon (RETIRED) gentoo-dev 2012-03-11 22:50:49 UTC
If you want this to make it into the tree, do not point me at random overlays, attach your files here in plaintext format.
Comment 64 Andrew Savchenko gentoo-dev 2012-03-11 23:17:17 UTC
Nobody cared to get this into the tree for 4.5 damn *years*! That's not a week or two. Especially taking into account that none of in-tree l2tp clients or servers are capable to use l2tp kernel native module. And this one does, moreover they wrote it and pushed to the vanilla kernel.

I wrote message here who those interested in package me, people asked me above.

This package requires a list of patches and other files and I'm tired of posting each small change here. If you care about pushing this to the tree, I'll upload all 19 files in then plain text format. If not, just save my effort.
Comment 65 Jaco Kroon 2016-09-20 14:11:05 UTC
Created attachment 446912 [details, diff]
net-dialup/openl2p prepared patch for portage

Tony - as per usual:  git am filename (or git apply if you'd like to first check my sanity).

repoman is happy with this (had to make minor modifications from the version I've been using for as long as this bug is old).  Dit perform a compile test post that:

greyscale openl2tp # ebuild openl2tp-1.8.ebuild clean merge      
...
>>> net-dialup/openl2tp-1.8 merged.
greyscale openl2tp #
Comment 66 Andrew Savchenko gentoo-dev 2016-09-20 15:20:55 UTC
Note: I have openl2tpd-1.8-r6 in my overlay:
https://gitweb.gentoo.org/dev/bircoph.git/tree/net-dialup/openl2tp

Quite stable (works for years for me and other people fine). Probably needs some improvement for underlying device creation detection, but that's a minor issue.

If someone needs at the tree, I can move it. Actually it is on my list already, but not the top priority.
Comment 67 Tony Vroon (RETIRED) gentoo-dev 2018-03-14 09:37:19 UTC
(In reply to Andrew Savchenko from comment #66)
> If someone needs at the tree, I can move it.

Please make it so.
Comment 68 Andrew Savchenko gentoo-dev 2018-03-19 06:29:09 UTC
(In reply to Tony Vroon from comment #67)
> (In reply to Andrew Savchenko from comment #66)
> > If someone needs at the tree, I can move it.
> 
> Please make it so.

It works perfectly with <glibc-2.26. In >=glibc-2.26 rpc was separated with a huge regression: rpcgen (in net-libs/rpcsvc-proto now) no longer supports -N and -M options.

I'm not sure how to proceed. Even if I'll ship pregenerated files with package, libtirpc is not thread safe anymore. This is an awful regression.
Comment 69 Alix 2018-03-19 07:02:03 UTC
(In reply to Andrew Savchenko from comment #68)
> I'm not sure how to proceed. Even if I'll ship pregenerated files with
> package, libtirpc is not thread safe anymore. This is an awful regression.

is it possible to run openl2tpd without rpc as a workaround? I see that openl2ptd has a command line option to load config file directly, although the init script has a specific note about this: "if rpc is enabled do not read config file by daemon (has bugs)". is it really that bad?
Comment 70 Andrew Savchenko gentoo-dev 2018-03-19 07:50:36 UTC
(In reply to Alix from comment #69)
> (In reply to Andrew Savchenko from comment #68)
> > I'm not sure how to proceed. Even if I'll ship pregenerated files with
> > package, libtirpc is not thread safe anymore. This is an awful regression.
> 
> is it possible to run openl2tpd without rpc as a workaround? I see that
> openl2ptd has a command line option to load config file directly, although
> the init script has a specific note about this: "if rpc is enabled do not
> read config file by daemon (has bugs)". is it really that bad?

Even with RPC support disabled openl2tp requires rpc headers to be generated in order to compile. However, it looks like libtirpc is thread-safe client-side, and that will be sufficient for our needs. rpcgen from rpcsvc-proto can be patched to support all options openl2tp needs, see bug 650852.
Comment 71 Jaco Kroon 2018-03-19 08:23:23 UTC
(In reply to Alix from comment #69)
> (In reply to Andrew Savchenko from comment #68)
> > I'm not sure how to proceed. Even if I'll ship pregenerated files with
> > package, libtirpc is not thread safe anymore. This is an awful regression.
> 
> is it possible to run openl2tpd without rpc as a workaround? I see that
> openl2ptd has a command line option to load config file directly, although
> the init script has a specific note about this: "if rpc is enabled do not
> read config file by daemon (has bugs)". is it really that bad?

The config loader is one or the other.  It'll either read the config statically ([-rpc]) or you need to load it via rpc ([rpc]).  So the init script will then revert to using using rpc to load the config files compared to passing the config options to load it direct.  I can't remember if this was due to a bug because it didn't load correctly or whether it outright didn't support it correctly, either way, if userpc=yes then the init script will load the configs using RPC rather than by -c option (which if I recall resulted in badness).

rpc (functionality, not headers, as per Andrew the header generation is still required) is really only required if you need a dynamic configuration, or need to be able to change configs without restarting the daemon (a moot point for my very much static configurations).
Comment 72 Andrew Savchenko gentoo-dev 2018-03-19 10:30:09 UTC
(In reply to Jaco Kroon from comment #71)
> The config loader is one or the other.  It'll either read the config
> statically ([-rpc]) or you need to load it via rpc ([rpc]).  So the init
> script will then revert to using using rpc to load the config files compared
> to passing the config options to load it direct.  I can't remember if this
> was due to a bug because it didn't load correctly or whether it outright
> didn't support it correctly, either way, if userpc=yes then the init script
> will load the configs using RPC rather than by -c option (which if I recall
> resulted in badness).

Current problem is not related to config loader directly. l2tp_rpc.h is being used through the codebase even wher RPC config management is disable. I'm not sure this can be fixed without full code refactoring.

So, build dep on rpcgen will be always present, runtime dep on rpc stuff may be disabled via USE flag.

Anyway, rpcsvc-proto should be fixed to be compatible with rpcgen -N -M.
Comment 73 Andrew Savchenko gentoo-dev 2018-07-02 20:44:34 UTC
libtirpc problem should be fixed in openl2tpd-1.8-r8 in my overlay:
https://gitweb.gentoo.org/dev/bircoph.git/tree/net-dialup/openl2tp

Please test. If OK, I'll push to the main tree.
Comment 74 Alix 2018-07-03 07:46:37 UTC
won't build on a test environment (current stable hardened x86), unless I'm doing something wrong...

build.log: https://gist.github.com/allixx/cf7f6cd5ed1fbee8d81ef350d68ee773
emerge --info: https://gist.github.com/allixx/3b6865df927c990fd53e386fd31881bd

[....snip....]

gcc -c -O2 -march=i686 -pipe -fomit-frame-pointer -I. -Iusl -Icli -isystem include -MMD -Wall -Wno-strict-aliasing   -DL2TP_ASYNC_RPC  -DSYS_LIBDIR=/usr/lib  -isystem /usr/include/tirpc l2tp_api.c -o l2tp_api.o
In file included from l2tp_api.c:26:0:
/usr/include/tirpc/rpc/pmap_clnt.h:70:8: error: unknown type name тАШbool_tтАЩ
 extern bool_t	pmap_set(u_long, u_long, int, int);
	^~~~~~
/usr/include/tirpc/rpc/pmap_clnt.h:70:41: error: expected тАШ)тАЩ before тАШintтАЩ
 extern bool_t	pmap_set(u_long, u_long, int, int);
					 ^~~
/usr/include/tirpc/rpc/pmap_clnt.h:71:8: error: unknown type name тАШbool_tтАЩ
 extern bool_t	pmap_unset(u_long, u_long);
	^~~~~~
/usr/include/tirpc/rpc/pmap_clnt.h:74:10: error: unknown type name тАШu_longтАЩ; did you mean тАШlongтАЩ?
	  u_long, u_long, u_long,
	  ^~~~~~
	  long
/usr/include/tirpc/rpc/pmap_clnt.h:74:18: error: unknown type name тАШu_longтАЩ; did you mean тАШlongтАЩ?
	  u_long, u_long, u_long,
		  ^~~~~~
		  long
/usr/include/tirpc/rpc/pmap_clnt.h:74:26: error: unknown type name тАШu_longтАЩ; did you mean тАШlongтАЩ?
	  u_long, u_long, u_long,
			  ^~~~~~
			  long
/usr/include/tirpc/rpc/pmap_clnt.h:75:10: error: unknown type name тАШxdrproc_tтАЩ
	  xdrproc_t, caddr_t,
	  ^~~~~~~~~
/usr/include/tirpc/rpc/pmap_clnt.h:75:21: error: unknown type name тАШcaddr_tтАЩ
	  xdrproc_t, caddr_t,
		     ^~~~~~~
/usr/include/tirpc/rpc/pmap_clnt.h:76:10: error: unknown type name тАШxdrproc_tтАЩ
	  xdrproc_t, caddr_t,
	  ^~~~~~~~~
/usr/include/tirpc/rpc/pmap_clnt.h:76:21: error: unknown type name тАШcaddr_tтАЩ
	  xdrproc_t, caddr_t,
		     ^~~~~~~
/usr/include/tirpc/rpc/pmap_clnt.h:77:26: error: unknown type name тАШu_longтАЩ; did you mean тАШlongтАЩ?
	  struct timeval, u_long *);
			  ^~~~~~
			  long
/usr/include/tirpc/rpc/pmap_clnt.h:79:23: error: expected тАШ)тАЩ before тАШvoidтАЩ
	    xdrproc_t, void *,
		       ^~~~
/usr/include/tirpc/rpc/pmap_clnt.h:82:8: error: unknown type name тАШu_shortтАЩ
 extern u_short	 pmap_getport(struct sockaddr_in *,
	^~~~~~~
/usr/include/tirpc/rpc/pmap_clnt.h:83:10: error: unknown type name тАШu_longтАЩ; did you mean тАШlongтАЩ?
	  u_long, u_long, u_int);
	  ^~~~~~
	  long
/usr/include/tirpc/rpc/pmap_clnt.h:83:18: error: unknown type name тАШu_longтАЩ; did you mean тАШlongтАЩ?
	  u_long, u_long, u_int);
		  ^~~~~~
		  long
/usr/include/tirpc/rpc/pmap_clnt.h:83:26: error: unknown type name тАШu_intтАЩ; did you mean тАШintтАЩ?
	  u_long, u_long, u_int);
			  ^~~~~
			  int
gcc -I. -MMD -w -O2 -march=i686 -pipe -fomit-frame-pointer -I. -Iusl -Icli -isystem include -MMD -Wall -Wno-strict-aliasing   -DL2TP_ASYNC_RPC	-DSYS_LIBDIR=/usr/lib  -isystem /usr/include/tirpc  -isystem /usr/include/tirpc -c -DYY_NO_UNPUT l2tp_config_token.c
make: *** [Makefile:277: l2tp_api.o] Error 1
make: *** Waiting for unfinished jobs....
 * ERROR: net-dialup/openl2tp-1.8-r8::local failed (compile phase):
 *   emake failed
Comment 75 Alix 2018-07-03 08:39:02 UTC
(In reply to Alix from comment #74)
> won't build on a test environment (current stable hardened x86), unless I'm
> doing something wrong...

upgrading stable net-libs/libtirpc-1.0.2-r1 to net-libs/libtirpc-1.0.3 ~x86 helped with build errors
Comment 76 Alix 2018-07-03 16:25:27 UTC
(In reply to Andrew Savchenko from comment #73)
> libtirpc problem should be fixed in openl2tpd-1.8-r8 in my overlay:
> https://gitweb.gentoo.org/dev/bircoph.git/tree/net-dialup/openl2tp
> 
> Please test. If OK, I'll push to the main tree.

builds (with net-libs/libtirpc-1.0.3) and works with client & rpc useflags. awesome!
Comment 77 Larry the Git Cow gentoo-dev 2018-07-03 18:54:27 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24d104cdffb3fd63356d3b9aadadc34ba10c3779

commit 24d104cdffb3fd63356d3b9aadadc34ba10c3779
Author:     Andrew Savchenko <bircoph@gentoo.org>
AuthorDate: 2018-07-03 18:49:29 +0000
Commit:     Andrew Savchenko <bircoph@gentoo.org>
CommitDate: 2018-07-03 18:53:23 +0000

    net-dialup/openl2tp: import from bircoph overlay
    
    Import version long term used in overlay with RPC support fixed to
    use libtirpc after it was removed from glibc.
    
    Closes: https://bugs.gentoo.org/195461
    Signed-off-by: Andrew Savchenko <bircoph@gentoo.org>
    Package-Manager: Portage-2.3.41, Repoman-2.3.9

 net-dialup/openl2tp/Manifest                       |   1 +
 .../openl2tp/files/examples/client.openl2tpd.conf  |  30 ++
 .../files/examples/server-radius.openl2tpd.conf    |  28 ++
 .../openl2tp/files/examples/server.openl2tpd.conf  |  36 +++
 .../files/examples/server.options.openl2tpd        |  23 ++
 .../openl2tp/files/openl2tp-1.8-cflags.patch       |  34 +++
 .../files/openl2tp-1.8-clientip_as_ipparam.patch   | 217 +++++++++++++++
 .../files/openl2tp-1.8-configure-Makefile.patch    |  58 ++++
 .../openl2tp/files/openl2tp-1.8-l2tpconfig.patch   |  15 +
 .../openl2tp/files/openl2tp-1.8-ldflags.patch      |  73 +++++
 net-dialup/openl2tp/files/openl2tp-1.8-man.patch   |  40 +++
 .../openl2tp/files/openl2tp-1.8-optionsfile.patch  | 306 +++++++++++++++++++++
 .../files/openl2tp-1.8-parallelbuild.patch         |  30 ++
 .../openl2tp/files/openl2tp-1.8-pppd-2.patch       |  12 +
 .../openl2tp/files/openl2tp-1.8-setkey.patch       |  12 +
 net-dialup/openl2tp/files/openl2tp-1.8-tirpc.patch |  53 ++++
 .../openl2tp/files/openl2tp-1.8-unused-var.patch   |  21 ++
 .../openl2tp/files/openl2tp-1.8-werror.patch       |  36 +++
 net-dialup/openl2tp/files/openl2tpd.confd          |  17 ++
 net-dialup/openl2tp/files/openl2tpd.initd          |  69 +++++
 net-dialup/openl2tp/metadata.xml                   |  17 ++
 net-dialup/openl2tp/openl2tp-1.8.ebuild            | 127 +++++++++
 22 files changed, 1255 insertions(+)
Comment 78 Andrew Savchenko gentoo-dev 2018-07-03 18:59:02 UTC
(In reply to Alix from comment #76)
> (In reply to Andrew Savchenko from comment #73)
> > libtirpc problem should be fixed in openl2tpd-1.8-r8 in my overlay:
> > https://gitweb.gentoo.org/dev/bircoph.git/tree/net-dialup/openl2tp
> > 
> > Please test. If OK, I'll push to the main tree.
> 
> builds (with net-libs/libtirpc-1.0.3) and works with client & rpc useflags.
> awesome!

Thanks for testing. There was an RPC API change and I had to modify opel2tp RPC implementation, so I was not 100% sure it works fine.

Please note revision number is dropped, since this is a new package to the main tree. Removed from the overlay.