Samuel Thibault
1db43fc51d
Separate out PPP processing
...
So we can later call it on frames obtained from kernel ppp interface.
Better seen with diff -w
2024-05-13 20:14:38 +02:00
Samuel Thibault
79a08faea9
Generalize L2TP UDP socket creation
...
So we can later use it to create per-tunnel L2TP sockets.
2024-05-13 20:14:38 +02:00
Samuel Thibault
5df78e9467
Separate out if configuration into setupif
...
So we can later apply it to ppp interfaces.
Better seen with diff -w
2024-05-13 20:14:38 +02:00
Samuel Thibault
b2bc6da827
Add support for deleting all kernel tunnels/sessions
...
Unfortunately, tunnels and session can survive us, so we have to drop any
tunnel/session left from a previous instance that might have crashed.
2024-05-13 20:14:38 +02:00
Samuel Thibault
1f4d79ce85
Add L2TP kernel infrastructure
...
This essentially exposes the kernel features, without using them yet.
2024-05-13 20:14:38 +02:00
Samuel Thibault
5db476bb6e
Add generic netlink infrastructure
2024-05-13 20:14:38 +02:00
Samuel Thibault
60329986b2
Rename netlink infrastructure to rtnetlink
...
We will introduce genetlink infrastructure just after this.
2024-05-13 20:14:38 +02:00
Samuel Thibault
fdf19f5467
cli: Fix missing closing file descriptors
2024-05-13 20:14:38 +02:00
Samuel Thibault
32799f196a
cli: Show bundle id
2024-05-12 23:35:46 +02:00
Samuel Thibault
b1fbf5885a
Homogeneize naming with debian
2024-05-07 12:48:39 +02:00
Samuel Thibault
29f3409ef4
Make sure that the acct directory exists on bootup
2024-05-07 12:45:03 +02:00
Samuel Thibault
e9c1c31682
cluster: Save counters before we leave
2024-03-12 19:45:20 +01:00
sthibaul
cbe2b3910f
Merge branch 'chap_passwd' into 'master'
...
Fix the password used when acting as LAC
See merge request l2tpns/l2tpns!22
2024-03-12 00:49:17 +00:00
Samuel Thibault
e442a69fc1
cluster: try make the cluster socket high-priority
...
The heartbeat messages, notably, should really not be lost, otherwise the
cluster will dismantle itself if some very-high trafic is filling packet
queues.
2024-01-26 01:51:54 +01:00
Samuel Thibault
878e9dd88a
RA: fix typo
...
It happens that htonl(9000) = 10275 so it's not so bad, but better be
correct :)
2024-01-25 10:31:06 +01:00
Samuel Thibault
135ada4008
cli: Fix showing local IP
2024-01-21 23:23:00 +01:00
Samuel Thibault
9daccab8ba
shutdown_handler: really shutdown when we are last
...
If we are a master and we don't have peers, there is no use keeping the
sessions alive, when we'll restart we will have forgotten them all.
Better gracefully close them, so they can be quickly respawn on restart,
instead of having to wait for timeouts.
2024-01-21 00:36:39 +01:00
Samuel Thibault
2229ac6a8a
RA: Fix announcing on the right tunnel
...
We were previously just announcing on the last tunnel looked at in the loop
much above.
2024-01-18 11:53:00 +01:00
Samuel Thibault
e6a933153d
RA: announce after the actions which may be dropping the session
...
It's useless to announce RA just before dropping the session.
2024-01-18 10:13:00 +01:00
Samuel Thibault
1d19366e15
typo
2024-01-18 02:39:32 +01:00
Samuel Thibault
0adfa09090
typo
2024-01-18 02:36:07 +01:00
sthibaul
7ddeea4205
Merge branch 'data_out_warn' into 'master'
...
Warn about tunnel buffer being full only once per second
See merge request l2tpns/l2tpns!24
2024-01-18 01:02:56 +00:00
Samuel Thibault
640590a252
cli: Also show local IP
2024-01-17 20:01:27 +01:00
Samuel Thibault
58e04d8f08
cli: Also show remote tunnel id
2024-01-17 13:10:51 +01:00
Samuel Thibault
1f1b8d7b99
Enforce assumption
2024-01-17 00:48:14 +01:00
Samuel Thibault
deed73f28f
typo
2024-01-14 18:26:48 +01:00
Samuel Thibault
db17a9a10b
cli: Also show routes and ipv6 in session output
2024-01-05 18:40:12 +01:00
Samuel Thibault
3186e8aa99
Add support for easily formatting IPv6 addresses
2024-01-05 18:40:00 +01:00
Samuel Thibault
01f0062d2d
cli: Support showing session by login
2024-01-05 18:39:36 +01:00
Samuel Thibault
943717e48d
Add needrestart file
...
To let administrator when to drop all sessions
2024-01-05 14:11:38 +01:00
Samuel Thibault
6be06966e3
Use Makefile rules to generate documentation
...
And regenerate documentation.
2023-12-24 15:42:03 +01:00
Samuel Thibault
986961ad5d
Add missing mp_mrru option in manpage source
2023-12-24 15:33:09 +01:00
Samuel Thibault
05772e2295
Add periodic RA sends
...
The RFC indeed say that we should send them periodically. We were
previously only sending them along LCP echo replies, but echo requests
are typically sent only when there is no trafic, which RA need to be
sent even when there is trafic.
2023-12-04 19:41:57 +01:00
Samuel Thibault
3be9b1657a
Note what changed in versions 8, 9 and 10
2023-12-03 21:24:54 +01:00
Samuel Thibault
01576b74da
typo
2023-11-08 01:37:01 +01:00
Samuel Thibault
3667bdfe80
Also clamp MSS on IPv6
...
Some routers erratically drop "Packet too big" icmp messages, and PMTU
discovery then doesn't work. We can however easily clamp MSS on IPv6 too.
2023-11-05 17:21:14 +01:00
sthibaul
7514eecf68
Merge branch 'initippool_memset' into 'master'
...
initippool: fix initialization of ip_address_pool
See merge request l2tpns/l2tpns!27
2023-08-02 21:31:13 +00:00
Dominique Martinet
1a89fc3f63
initippool: drop redundant memset
...
The size of the memset was just wrong, but the data has already been
zeroed in initdata so we can just remove it.
# This is the commit message #2 :
# squash! initippool: fix initialization of ip_address_pool
2023-08-03 06:10:27 +09:00
sthibaul
43e25849b2
Merge branch 'icmp_header' into 'master'
...
icmp.c: do not include linux headers
See merge request l2tpns/l2tpns!26
2023-08-02 20:49:10 +00:00
Dominique Martinet
e168cc6ff7
icmp.c: do not include linux headers
...
net/if.h and linux/if.h headers conflict with each other as of linux
6.3 and glibc 2.37 headers:
In file included from /usr/include/linux/icmp.h:23,
from icmp.c:5:
/usr/include/net/if.h:44:5: error: redeclaration of enumerator ‘IFF_UP’
44 | IFF_UP = 0x1, /* Interface is up. */
| ^~~~~~
/usr/include/linux/if.h:83:9: note: previous definition of ‘IFF_UP’ with type ‘enum net_device_flags’
83 | IFF_UP = 1<<0, /* sysfs */
| ^~~~~~
icmp.c gets net/if.h from l2tpns.h, and linux/if.h from linux/icmp.h.
In our case, we do not need to use the linux headers at all here as we
are doing normal userspace things: just use glibc headers all the way.
This has been tested with kernel 3.2 / glibc 2.13 headers, so it's
probably fine. (l2tpns does not currently build with musl)
2023-08-03 05:29:01 +09:00
sthibaul
b46c2aa671
Merge branch 'cli' into 'master'
...
Add more information in show session/tunnel
See merge request l2tpns/l2tpns!25
2023-04-30 18:10:57 +00:00
Samuel Thibault
90b7d4a0dc
Add more information in show session/tunnel
2023-04-30 20:10:01 +02:00
Samuel Thibault
7fd81113e6
Warn about tunnel buffer being full only once per second
...
Otherwise, when the network output bandwidth is full, we additionally
fill the disk with logs.
2023-04-30 16:31:55 +02:00
Samuel Thibault
b0a93e8809
Lower log level of IPV6CP warning
...
Level 2 is actually often used.
Ref #10
2023-04-23 13:56:48 +02:00
Samuel Thibault
7bf791816c
Fix the password used when acting as LAC
...
When acting as LNS, we have to answer challenges with our own secret, but
when acting as LAC, we have to answer challenges with the LNS secret, not
ours.
2023-03-26 18:01:00 +02:00
sebian
3a5bd840b2
Merge branch 'mp_mrru' into 'master'
...
Add mp_mrru option
See merge request l2tpns/l2tpns!20
2023-03-05 17:40:29 +00:00
Samuel Thibault
8e7bfa9a77
Add mp_mrru option
...
Some equipments seem not able to actually put options in Configure-Reject
messages, so we then have to disable MRRU by hand.
2023-02-07 12:45:29 +01:00
zorun
b3b5fc5c59
Merge branch 'chap_nack' into 'master'
...
LCP: accept an auth nack to CHAP with length == 4
See merge request l2tpns/l2tpns!19
2022-12-14 20:51:46 +00:00
Samuel Thibault
af9cb755ab
LCP: accept an auth nack to CHAP with length == 4
...
It seems at least some products send this:
{LCP (0xc021), length 12: LCP, Conf-Nack (0x03), id 9, length 10
encoded length 8 (=Option(s) length 4)
0x0000: c021 0309 0008
Auth-Prot Option (0x03), length 4: CHAP[|lcp]}
If we refuse to nack to CHAP, we'd stay stuck with PAP and eventually
get a reject.
2022-12-14 19:08:07 +01:00
sthibaul
19ee48869f
Merge branch 'coverity' into 'master'
...
coverity misc fixes
See merge request l2tpns/l2tpns!18
2022-11-05 22:27:07 +00:00