Commit graph

22 commits

Author SHA1 Message Date
Samuel Thibault
c3eb1be0b4 Separate out DHCP processing
So we can later call it on UDP datagrams obtained from UDP socket.
2024-05-13 20:14:38 +02: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
1d19366e15 typo 2024-01-18 02:39:32 +01:00
Samuel Thibault
0adfa09090 typo 2024-01-18 02:36:07 +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
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
fendo
9c77145f71 Add of the RDNSS option to ICMPv6 Router Advertisement (RA). 2014-10-02 00:28:57 +02:00
fendo
8d94f2020d new feature: If the user attribute "Framed-IPv6-Address" is defined then the ICMPv6_RA advertise this IPv6 address.
Fix: Incorrect delegation of IPv6 prefixes when multiple of 4 bits (nibble) (eg: /44, /52 ...).
2014-09-18 18:16:21 +02:00
fendo
b3f40f41f7 Add DHCPv6 functionality. 2014-09-11 16:19:57 +02:00
fendo
11996ba414 Add PPPOE-SERVER functionality 2013-01-08 10:50:57 +01:00
Brendan O'Dea
d5c6f84271 Import to git from cvs. Remove keywords. 2011-01-27 17:36:01 +11:00
Brendan O'Dea
5faf075c8d add Multilink support from Khaled Al Hamwi 2006-04-27 09:53:49 +00:00
Brendan O'Dea
f22a9cebbe normalise session, tunnel args 2005-08-10 11:25:56 +00:00
Brendan O'Dea
aabf1d3fe9 - Replace flags used for LCP/IPCP with state machine.
- Use openssl MD5, fix DAE vector (Alex Kiernan).
2005-07-31 10:04:09 +00:00
Brendan O'Dea
788fb3cb6d use router address 2005-06-04 15:42:06 +00:00
Brendan O'Dea
08360e49b4 finish incorporating ipv6 patches 2005-01-25 04:19:04 +00:00
Brendan O'Dea
9d199a1046 use standard uintN_t types for portability 2004-12-16 08:49:52 +00:00
Brendan O'Dea
4f5ea4fbe0 - Ignore gateway address in Framed-Route (from Jonathan McDowell).
- Call sessionshutdown() when a tunnel is dropped rather than
  sessionkill() to ensure that RADIUS stop records are sent.
- Cleanup: make a bunch of global functions/variables static.
2004-11-16 07:54:32 +00:00
Brendan O'Dea
a4064493e1 Fix socket creation in host_unreachable() (thanks to Bjrn Augestad) 2004-11-15 02:26:20 +00:00
David Parrish
7aa420ce9f * Update cli callbacks to work with libcli 1.6.
This supports privileged and unprivileged commands, as well as a configuration
  mode
* Add help for all cli commands
* Add "show version" command
* Fix uptime counter display
* Fix nasty bug where cluster basetime can be set to 0 when sending initial
  heartbeat
* Don't rmmod ip_conntrack, as this can take a lot of time
* Re-order logging in routeset such that the action is given before any error
* Use the correct gateway address when deleting routes
* Remove any routes when address changes
* Require authentication if telnet from remote ip
* Require enable password always
* Return error if show pool done on slave
* We MUST immediately exit if we're the wrong master!
2004-06-28 02:43:13 +00:00
David Parrish
c239d4b228 * Wed Jun 23 2004 David Parrish <david@dparrish.com> 2.0.0
- Major release
- Completely replace active/standby clustering with a new peer-to-peer
  clustering method which allows much greater throughput and is a lot more fault
  tolerant
- Add internal tbf implementation for throttling without relying on tc and
  kernel HTB
- Add support for iBGP and eBGP to advertise routes
- Add cli commands "show cluster", "show bgp", "show ipcache", "show throttle",
  "show tbf", "suspend bgp", "restart bgp", "show user"
- Interception destination must be set per-user
- If SMP machine, allow use of SCHED_FIFO, which should improve performance
- Added config option to send GARP at startup
- Added plugin_become_master and plugin_new_session_master plugin hooks
- Remove useless sessionsendarp(). This isn't needed now that we are using TUN
  instead of TAP.
- ICMP rate limiting so not every unreachable packet is replied with an ICMP
  unreachable message
- mangle table is not required on anything but the cluster master, so slaves
  will drop the mangle table and attempt to unload the ip_conntrack module
- Statically assigned IP addresses (by Radius) work now
- Add -d command-line flag to detach and become a daemon
- Configuration file is now "/etc/l2tpns/startup-config"
- Reduced MIN_IP_SIZE to 0x19 to stop a pile of Short IP warnings
- Resend initial IPCP request until it's acknowleged by the client
- Better radius session cleanup logic
- Many miscellaenous bugfixes and performance enhancements
- Thanks to Michael O'Reilly and Brendan O'Dea for most of these new features
2004-06-23 03:52:24 +00:00
David Parrish
fc0a363208 * Fri Mar 5 2004 David Parrish <david@dparrish.com> 1.1.0
- Change all strcpy() calls to strncpy() to avoid buffer overflow potential
- Add ICMP host unreachable support
- Logging to syslog if log_file = "syslog:facility"
- Now requires libcli 1.5
- All configuration moves to a config structure
- Ability to modify and write config on the fly through command-line interface
- Config file support is removed, and now handled by the cli
- Show hostname in cli prompt
- Keep current state type for tunnels
- Add uptime command do CLI, which also shows real-time bandwidth utilisation
- Add goodbye command to cluster master, which forces droppping a slave
- Cache IP address allocation, so that reconnecting users get the same address
- Fix tunnel resend timeouts, so that dead tunnels will be cleaned up
- Allocate tunnels and radius without using a linked list which had issues
- Fix some off-by-one errors in tunnel and session and radius arrays
- Save and reload ip address pool when dieing
- Check version and size of reloaded data when restarting
- Remove plugin_config support
- Remove old support for TBF which didn't work anyway. HTB is required to do throttling now.
- Add COPYING and Changes files
2004-03-05 00:09:03 +00:00