Commit Graph

293 Commits

Author SHA1 Message Date
Harald Welte 34f49239c3 add warning about hard-coded IP
Change-Id: I6e0128072a7f4a51df19aaee2d08ecef05cee2be
2020-07-19 19:10:52 +02:00
Oliver Smith 8c570c8cb0 src/test_connect.c: fix compile with Werror
test_connect.c:50:2: error: format not a string literal and no format arguments [-Werror=format-security]
  printf(msgb_hexdump(msg));
  ^~~~~~

Change-Id: Ie0104649104ff31e180c05993e707c6629ddbf83
2020-05-11 11:46:41 +02:00
Harald Welte 1cdac78eb0 add contrib/jenkins.sh for build verification
Change-Id: I17831483664e4c17f2e59b3850a88e3169fa06a4
2020-05-03 21:31:14 +02:00
Harald Welte 08bff6424e l2tpd_packet: Fix compiler warnings
../../../src/l2tpd_packet.c: In function ‘l2tp_rcvmsg_control’:
../../../src/l2tpd_packet.c:586:26: error: ‘router_id’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  586 |    l2c->remote.router_id = router_id;
      |    ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
../../../src/l2tpd_packet.c:577:25: note: ‘router_id’ was declared here
  577 |   uint32_t remote_ccid, router_id;
      |                         ^~~~~~~~~
../../../src/l2tpd_packet.c:582:20: error: ‘remote_ccid’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  582 |   l2c->remote.ccid = remote_ccid;
      |   ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~

Change-Id: I8d44ca64b2fc08184b40d16b90273c2a152ef00c
2020-05-03 21:31:11 +02:00
Harald Welte 19f433e2d5 avoid compiler warnings: comment-out unused code
Change-Id: I53229e7041272d2f451f61bff7edb4ae8c40ddea
2020-05-03 21:31:03 +02:00
Harald Welte d21cf0d7a7 Add copyright statements + license disclaimer everywhere 2020-05-03 19:28:03 +02:00
Harald Welte e1c4716fa6 convert to autotools 2020-05-03 19:28:03 +02:00
Harald Welte df3b385b34 rename paths 2020-05-03 19:28:01 +02:00
Harald Welte 1e399e69e8 The socket is not MNCC (copy+paste error) 2020-05-03 19:27:46 +02:00
Alexander Couzens f6964b0659 l2tpd: introduce a version/datacontrol header (2byte) for RSL/OML unix socket
The ALT TC/Superchannel switch requires a seperate side channel. By introducing a header this
can be done in a clean way within the RSL/OML channel. So every packet gets
- 1 byte version
- 1 byte data or control
2020-05-03 19:27:45 +02:00
Alexander Couzens 2e6868f4c4 l2tpd: rename unix_rsl_oml_cb -> unix_read_cb:
it's used by all unix sockets
2020-05-03 19:27:45 +02:00
Alexander Couzens 17faeefa27 l2tpd_lapd: remove unsued unix_trau_cb|unix_pgsl_cb
These functions are only dummy functions in case pgsl, rsl, trau requires very different handling.
2020-05-03 19:27:45 +02:00
Alexander Couzens e49f36bc28 l2tpd_lapd: move assignment of channel->session under check of channel->session 2020-05-03 19:27:45 +02:00
Alexander Couzens 3d2c99c54d l2tpd_lapd/lapd_ehdlc_to_lapd(): improve log message 2020-05-03 19:27:45 +02:00
Alexander Couzens 93ec7f0aed l2tpd_lapd: improve lapd_ehdlc_to_lapd() function comment 2020-05-03 19:27:45 +02:00
Alexander Couzens aa97a1d4b1 l2tpd_lapd: fix memleak when sending data to unix sockets
The msg was allocated a second time by msgb_copy() even when lapd_ehdlc_to_lapd
handles the further allocation itself. Meaning every data packet leaked.
2020-05-03 19:27:45 +02:00
Alexander Couzens 0400931ac2 l2tpd_packet: remove superfluous `;` 2020-05-03 19:27:45 +02:00
Alexander Couzens 47b1285115 l2tpd_packet: remove handled fixme 2020-05-03 19:27:45 +02:00
Alexander Couzens 9f76bcd8e0 l2tpd_packet: improve log level and log messages 2020-05-03 19:27:45 +02:00
Alexander Couzens 5ba33810a2 l2tpd_lapd: check rc of wqueue_enqueue because
wqueue_enqueue now returns -ENOSPC when the queue is full
2020-05-03 19:27:45 +02:00
Alexander Couzens 183f9d6e5c l2tpd: add name to traffic_channels to improve logging 2020-05-03 19:27:45 +02:00
Alexander Couzens 6b0af57fdf l2tpd: zero struct sockaddr before using it 2020-05-03 19:27:45 +02:00
Alexander Couzens 9aadf0cf6d l2tpd: implement signal handler 2020-05-03 19:27:45 +02:00
Alexander Couzens a1a5c08e73 l2tpd: call msgb_talloc_ctx_init() to init msgb 2020-05-03 19:27:45 +02:00
Alexander Couzens c41a310fe2 move osmo_fsm_register() of fsm into constructor of l2tp_fsm.c 2020-05-03 19:27:45 +02:00
Alexander Couzens 923f4c9f1c l2tpd: move logging into own file 2020-05-03 19:27:45 +02:00
Harald Welte e6b5f61938 test_connect: remove 'socket.h'
At least debian doesn't have a 'socket.h' outside /usr/include/sys/
and 'man 7 socket' also states sys/socket.h as the proper reference.
2016-11-13 19:56:15 +01:00
Harald Welte f8b6837862 l2tpd: Add mechanism for explicitly ACKing a packet after 20ms
If we are not implicitly ACKing a control packet within 20ms of having
received it, let's send an explicit ACK.
2016-11-13 19:56:15 +01:00
Alexander Couzens 2d97ca9467 Merge branch 'lynxis' into master 2016-11-11 18:51:21 +01:00
Alexander Couzens eb07d89ffc l2tp_packet: dont answer an ACK with a StopCCN if connection is unknown
as long we don't do real ack handling, just ignore ACK without connection, because
on a StopCCN an ACK is sent out
2016-11-11 16:19:19 +01:00
Alexander Couzens 9143daf21e l2tp_packet: remove logoutput on every data packet 2016-11-11 16:18:24 +01:00
Alexander Couzens 95f8ae04bd lapd_switch_altc: allow to switch between timeslot and superchannel
a special crafted packet can switch between the modes. The packet look like
0x23004200 as magic and 1byte as value (0 = timeslot, 1 = superchannel)
2016-11-11 16:17:54 +01:00
Alexander Couzens 388a33ca9c lapd: use l2tp_msgb_alloc() instead of msgb_alloc() 2016-11-08 11:41:36 +01:00
Alexander Couzens 283c2c3257 lapd: free message in unix_rsl_oml_cb() 2016-11-08 11:41:36 +01:00
Harald Welte 8697fa7091 l2tpd socket naming: there's no oml associated with p-gsl or trau 2016-11-05 18:46:35 +01:00
Alexander Couzens 132c380336 add simple test_connect example programm 2016-11-05 18:46:35 +01:00
Alexander Couzens 52f099f27f fixup! implement l2tpd_tx_data including crc32 2016-11-05 18:46:35 +01:00
Alexander Couzens 5304db9a38 implement lapd decoding/encoding and rx/tx data path 2016-11-05 18:46:35 +01:00
Alexander Couzens 7bb03d7308 l2tpd_packet/controlconnection: improve sequence checks and log output 2016-11-05 18:46:35 +01:00
Alexander Couzens 7854b9abfb l2tpd_packet: correct usage of l2tpd_data functions 2016-11-05 18:46:35 +01:00
Alexander Couzens 4c3607544f fixup! implement l2tpd_tx_data including crc32 2016-11-05 18:46:35 +01:00
Alexander Couzens 0204667e06 l2tpd_socket: complete unix socket implementation 2016-11-05 18:46:35 +01:00
Alexander Couzens bcd9772fe5 implement l2tpd_tx_data including crc32 2016-11-05 18:46:35 +01:00
Alexander Couzens bc48fe2f98 l2tpd_packet: add msgb_free() after sending the message 2016-11-05 18:46:35 +01:00
Alexander Couzens 9b7111c3a2 l2tp_socket_init: setup log_class in l2tp_socket_init 2016-11-05 18:46:35 +01:00
Alexander Couzens 5b97a7ab47 l2tp_socket: handle unix sockets using wqueue 2016-11-05 18:46:35 +01:00
Alexander Couzens b0688440f0 l2tpd_data: search for a specific session_id using all connections
because sessions are unique per l2tp_instance we have to search over all connections to
find the correct session
2016-11-05 18:46:35 +01:00
Alexander Couzens 7916154136 l2tpd: move next_l_sess_id into l2tp_instance
the sessions are unique to the daemon. E.g. data packets only contain a
session id and no connection id
2016-11-05 18:46:35 +01:00
Alexander Couzens 0cd2a3d8bd l2tpd_packet/fsm: fix last missing parts for conf_fsm 2016-11-05 18:46:35 +01:00
Alexander Couzens 68ee0c9ef6 l2tpd_packet: add missing AVP ResultError for STOP_CCN 2016-11-05 18:46:35 +01:00