Well, it now gets to the stage of spawning two PPP daemons and having them talk to eachother. Below is the tcpdump over the loopback interface. As you can see they chat happily about all the various options. Since both interfaces are local it's a bit difficult to test transport traffic in both directions. But one-way traffic certainly works, as you can see below (I added a stupid route to a non-existant address). Included in the package is a pppox module for pppd. The compile it you need the pppd source, you compile it the same way the pppoatm module is compiled. It is being invoked as follows: # pppd debug noauth 10.0.0.4: local plugin pppox.so pppox 4 Basically the plugin adds a single new parameter "pppox" whose argument is the file descriptor to use. It verifies that the descriptor is indeed a PPPoX socket and if so, proceeds to use it as the transport. The works-in-UML-but-not-in-real-life bug is still there, my guess is that I'll just have to memcpy the whole packet myself rather than get the UDP layer to do it for me. But since this only affects something-other-than-PPP over L2TP I guess it's not a high priority. To the perosn who suggested subversion, I'm going to have to read more on it since it didn't appear "obvious" to me. Next step is to modify the L2TP daemon source to use this code. The most obvious thing missing for me is a way for the server to select tunnels/session to terminate. At the moment it's fire-and-forget. The L2TP can ignore a session once it has started. But since you want to have the PPP daemons eventually killed off (not just by LCP timeout) I figure an ioctl is necessary. Code at the usual place: http://svana.org/kleptog/kl2tp/kl2tp-0.2.tar.gz Thanks for all the help so far. 23:57:26.633583 127.0.0.1.1701 > 127.0.0.1.1702: l2tp:[O](3/4) {Conf-Req(1), MRU=1400, ACCM=00000000, Magic-Num=bb873c04, PFC, ACFC} (DF) [ttl 0] 23:57:26.687146 127.0.0.1.1702 > 127.0.0.1.1701: l2tp:[O](1/2) {Conf-Req(1), MRU=1400, ACCM=00000000, Magic-Num=5ef3b6bc, PFC, ACFC} (DF) [ttl 0] 23:57:26.712170 127.0.0.1.1701 > 127.0.0.1.1702: l2tp:[O](3/4) {Conf-Ack(1), MRU=1400, ACCM=00000000, Magic-Num=5ef3b6bc, PFC, ACFC} (DF) [ttl 0] 23:57:29.772066 127.0.0.1.1701 > 127.0.0.1.1702: l2tp:[O](3/4) {Conf-Req(1), MRU=1400, ACCM=00000000, Magic-Num=bb873c04, PFC, ACFC} (DF) [ttl 0] 23:57:29.795795 127.0.0.1.1702 > 127.0.0.1.1701: l2tp:[O](1/2) {Conf-Req(1), MRU=1400, ACCM=00000000, Magic-Num=5ef3b6bc, PFC, ACFC} (DF) [ttl 0] 23:57:29.821622 127.0.0.1.1701 > 127.0.0.1.1702: l2tp:[O](3/4) {Conf-Ack(1), MRU=1400, ACCM=00000000, Magic-Num=5ef3b6bc, PFC, ACFC} (DF) [ttl 0] 23:57:29.846329 127.0.0.1.1702 > 127.0.0.1.1701: l2tp:[O](1/2) {Conf-Ack(1), MRU=1400, ACCM=00000000, Magic-Num=bb873c04, PFC, ACFC} (DF) [ttl 0] 23:57:29.875960 127.0.0.1.1701 > 127.0.0.1.1702: l2tp:[O](3/4) {Echo-Req(0), Magic-Num=bb873c04} (DF) [ttl 0] 23:57:29.894923 127.0.0.1.1701 > 127.0.0.1.1702: l2tp:[O](3/4) {Conf-Req(1), IP-Comp VJ-Comp, IP-Addr=10.0.0.4} (DF) [ttl 0] 23:57:29.921823 127.0.0.1.1702 > 127.0.0.1.1701: l2tp:[O](1/2) {Echo-Req(0), Magic-Num=5ef3b6bc} (DF) [ttl 0] 23:57:29.946961 127.0.0.1.1701 > 127.0.0.1.1702: l2tp:[O](3/4) {Echo-Rep(0), Magic-Num=bb873c04} (DF) [ttl 0] 23:57:29.967286 127.0.0.1.1702 > 127.0.0.1.1701: l2tp:[O](1/2) {Conf-Req(1), IP-Comp VJ-Comp, IP-Addr=10.0.0.6} (DF) [ttl 0] 23:57:29.990707 127.0.0.1.1701 > 127.0.0.1.1702: l2tp:[O](3/4) {Conf-Ack(1), IP-Comp VJ-Comp, IP-Addr=10.0.0.6} (DF) [ttl 0] 23:57:30.011908 127.0.0.1.1702 > 127.0.0.1.1701: l2tp:[O](1/2) {Echo-Rep(0), Magic-Num=5ef3b6bc} (DF) [ttl 0] 23:57:30.042320 127.0.0.1.1702 > 127.0.0.1.1701: l2tp:[O](1/2) {Conf-Ack(1), IP-Comp VJ-Comp, IP-Addr=10.0.0.4} (DF) [ttl 0] <snip> 00:17:20.201108 127.0.0.1.1701 > 127.0.0.1.1702: l2tp:[O](3/4) {Echo-Req(1), Magic-Num=53d69c32} (DF) [ttl 0] 00:17:20.219246 127.0.0.1.1702 > 127.0.0.1.1701: l2tp:[O](1/2) {Echo-Req(1), Magic-Num=bd4e0862} (DF) [ttl 0] 00:17:20.233802 127.0.0.1.1702 > 127.0.0.1.1701: l2tp:[O](1/2) {Echo-Rep(1), Magic-Num=bd4e0862} (DF) [ttl 0] 00:17:20.257266 127.0.0.1.1701 > 127.0.0.1.1702: l2tp:[O](3/4) {Echo-Rep(1), Magic-Num=53d69c32} (DF) [ttl 0] <snip> PING 11.0.0.1 (11.0.0.1): 56 data bytes 00:17:21.908447 127.0.0.1.1701 > 127.0.0.1.1702: l2tp:[O](3/4) {10.0.0.4 > 11.0.0.1: icmp: echo request (DF)} (DF) [ttl 0] 00:17:21.920376 127.0.0.1 > 127.0.0.1: icmp: echo reply [ttl 0] 64 bytes from 127.0.0.1: icmp_seq=0 ttl=0 time=25.7 ms 00:17:22.960840 127.0.0.1.1701 > 127.0.0.1.1702: l2tp:[O](3/4) {10.0.0.4 > 11.0.0.1: icmp: echo request (DF)} (DF) [ttl 0] 00:17:22.972570 127.0.0.1 > 127.0.0.1: icmp: echo reply [ttl 0] 64 bytes from 127.0.0.1: icmp_seq=1 ttl=0 time=25.3 ms 00:17:25.050551 127.0.0.1.1701 > 127.0.0.1.1702: l2tp:[O](3/4) {10.0.0.4 > 11.0.0.1: icmp: echo request (DF)} (DF) [ttl 0] 00:17:25.062396 127.0.0.1 > 127.0.0.1: icmp: echo reply [ttl 0] 64 bytes from 127.0.0.1: icmp_seq=2 ttl=0 time=25.4 ms 00:17:27.140639 127.0.0.1.1701 > 127.0.0.1.1702: l2tp:[O](3/4) {10.0.0.4 > 11.0.0.1: icmp: echo request (DF)} (DF) [ttl 0] 00:17:27.152518 127.0.0.1 > 127.0.0.1: icmp: echo reply [ttl 0] 64 bytes from 127.0.0.1: icmp_seq=3 ttl=0 time=25.4 ms -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > "All that is needed for the forces of evil to triumph is for enough good > men to do nothing." - Edmond Burke > "The penalty good people pay for not being interested in politics is to be > governed by people worse than themselves." - Plato
Attachment:
pgp00131.pgp
Description: PGP signature