Yves Rutschle
e941e8dd2e
fix cppcheck complains
2023-08-31 15:10:53 +02:00
Yves Rutschle
54fe4b2f47
Merge pull request #401 from rnhmjoj/master
...
fix handling of IPv6 UDP connections
2023-08-26 21:32:22 +02:00
rnhmjoj
33129481cf
fix handling of IPv6 UDP connections
...
Problem:
IPv6 addresses are 4 bytes long and don't fit inside a `sockaddr`, so
`recvfrom` will truncate the address to the first half.
When generating a reply, the remaining half of the address is filled
with garbage and the packet is subsequently delivered to the wrong host,
if not immediately dropped.
Solution:
replace `sockaddr` with `sockaddr_storage`, the latter is guaranteed to
be large enough to hold an IPv6 address and pointers can be cast to
`sockaddr *` when needed.
2023-08-22 11:44:09 +02:00
Josh Soref
9e6d5cc13a
spelling: theoretical
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-07-30 01:43:12 -04:00
Josh Soref
8ef3e8ddd8
spelling: increase
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-07-30 01:43:12 -04:00
Josh Soref
3d959eb425
spelling: address
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-07-30 01:43:12 -04:00
Yves Rutschle
ee48dae8c5
fix potential file descriptor leak if set_nonblock () fails
2023-05-13 22:36:21 +02:00
Toni Uhlig
61af0b2e09
fix cppcheck complains
...
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2022-09-11 22:12:33 +02:00
yrutschle
a4db163a69
config sanity check that there is at least one target protocol for each family that we listen to ( fix #336 )
2022-07-10 21:16:41 +02:00
yrutschle
750e828d49
reinstate checking of FD_SETSIZE for sslh-select
2022-05-22 22:32:22 +02:00
yrutschle
f6fe735171
sort target protocols as TCP or UDP, so only appropriate probes are called by the listeners
2022-05-05 17:45:40 +02:00
yrutschle
006706a901
typo
2022-04-30 09:38:30 +02:00
yrutschle
cd664574f1
manage timeout with lists instead of linear searches
2022-04-27 17:28:13 +02:00
yrutschle
449fabba51
linked list sorted by timeout times
2022-04-24 18:35:09 +02:00
yrutschle
cd5d75fed9
fix off-by-one error that wont time out highest UDP file descriptor
2022-04-24 18:31:27 +02:00
yrutschle
8ac93c3e9d
abstract connection activation
2022-04-18 21:25:07 +02:00
yrutschle
35036c94c7
make UDP hash size configurable
2022-04-10 09:03:53 +02:00
yrutschle
21d00bd29d
remove globals for hash size
2022-04-10 08:45:01 +02:00
yrutschle
07ceb99280
remove unused variable
2022-04-02 19:04:49 +02:00
yrutschle
5fa03ec9a3
fix hash item type definition
2022-04-02 18:59:32 +02:00
yrutschle
9ce9b5cd82
Integrate hash for UDP
2022-04-02 18:48:24 +02:00
yrutschle
0a23ca133e
finalise UDP support for sslh-ev
2021-11-11 21:16:37 +01:00
yrutschle
207d482189
refactor: move udp timeout management to udp module
2021-11-09 18:27:52 +01:00
yrutschle
2e11001087
migrate UDP to new log system
2021-09-27 12:43:03 +02:00
yrutschle
40da147efd
keep track of next UDP timeout to only go through all connections when that happens
2021-08-06 22:29:00 +02:00
yrutschle
e4936454c5
refactor: take time only once when computing UPD timeouts
2021-08-05 17:05:08 +02:00
yrutschle
7fb65ad0ac
refactor: remove sideeffects from udp_timedout
2021-07-18 21:50:40 +02:00
yrutschle
de0ec959d9
make udp timeout configurable per protocol
2021-07-08 14:13:04 +02:00
yrutschle
e7df8eeaa1
removed static known_source arrays, UDP connections are now managed dynamically
2021-07-07 19:58:08 +02:00
yrutschle
bf57d63c3a
fix message for fd closure on timeout
2021-07-02 08:22:09 +02:00
yrutschle
862e33cfec
moved UDP support from sslh-fork to sslh-select
2021-07-01 22:44:35 +02:00
yrutschle
e678428334
clarify function name
2021-05-15 17:57:33 +02:00
yrutschle
edc42ca13b
clarify variable name
2021-05-15 17:39:34 +02:00
yrutschle
68fc10aed0
comment udp_listener prototype
2021-02-23 21:19:23 +01:00
yrutschle
49c136691c
refactor: move UDP code to its own file
2021-02-23 21:17:39 +01:00