mirror of
https://github.com/OpenVPN/openvpn.git
synced 2026-05-28 04:03:29 -04:00
manage: Change kill_by_addr to use better types for port/proto
Some checks are pending
Build / Check code style with clang-format (push) Waiting to run
Build / Android - arm64-v8a (push) Waiting to run
Build / gcc-mingw - x64 - OSSL (push) Waiting to run
Build / gcc-mingw - x86 - OSSL (push) Waiting to run
Build / mingw unittest argv - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest auth_token - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest buffer - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest crypto - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest cryptoapi - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest misc - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest ncp - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest options_parse - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest packet_id - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest pkt - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest provider - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest ssl - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest tls_crypt - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest user_pass - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest argv - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest auth_token - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest buffer - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest crypto - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest cryptoapi - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest misc - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest ncp - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest options_parse - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest packet_id - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest pkt - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest provider - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest ssl - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest tls_crypt - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest user_pass - x86 - OSSL (push) Blocked by required conditions
Build / gcc - ubuntu-24.04 - OpenSSL 3.0.13 --enable-pkcs11 (push) Waiting to run
Build / gcc - ubuntu-22.04 - OpenSSL 3.0.2 --enable-pkcs11 (push) Waiting to run
Build / gcc - ubuntu-22.04 - mbed TLS (push) Waiting to run
Build / gcc - ubuntu-24.04 - mbed TLS (push) Waiting to run
Build / clang-asan - ubuntu-22.04 - mbedtls (push) Waiting to run
Build / clang-asan - ubuntu-22.04 - openssl (push) Waiting to run
Build / clang-asan - ubuntu-24.04 - mbedtls (push) Waiting to run
Build / clang-asan - ubuntu-24.04 - openssl (push) Waiting to run
Build / macos-13 - libressl - asan (push) Waiting to run
Build / macos-13 - openssl@1.1 - asan (push) Waiting to run
Build / macos-13 - openssl@3 - asan (push) Waiting to run
Build / macos-14 - libressl - asan (push) Waiting to run
Build / macos-14 - openssl@1.1 - asan (push) Waiting to run
Build / macos-14 - openssl@3 - asan (push) Waiting to run
Build / macos-15 - libressl - asan (push) Waiting to run
Build / macos-15 - openssl@1.1 - asan (push) Waiting to run
Build / macos-15 - openssl@3 - asan (push) Waiting to run
Build / macos-13 - libressl - normal (push) Waiting to run
Build / macos-13 - openssl@1.1 - normal (push) Waiting to run
Build / macos-13 - openssl@3 - normal (push) Waiting to run
Build / macos-14 - libressl - normal (push) Waiting to run
Build / macos-14 - openssl@1.1 - normal (push) Waiting to run
Build / macos-14 - openssl@3 - normal (push) Waiting to run
Build / macos-15 - libressl - normal (push) Waiting to run
Build / macos-15 - openssl@1.1 - normal (push) Waiting to run
Build / macos-15 - openssl@3 - normal (push) Waiting to run
Build / msbuild - amd64 - openssl (push) Waiting to run
Build / msbuild - amd64-clang - openssl (push) Waiting to run
Build / msbuild - arm64 - openssl (push) Waiting to run
Build / msbuild - x86 - openssl (push) Waiting to run
Build / msbuild - x86-clang - openssl (push) Waiting to run
Build / clang asan - ubuntu-22.04 - libressl (push) Waiting to run
Build / gcc normal - ubuntu-22.04 - libressl (push) Waiting to run
Build / clang asan - ubuntu-22.04 - mbedtls3 (push) Waiting to run
Build / gcc normal - ubuntu-22.04 - mbedtls3 (push) Waiting to run
Build / clang asan - ubuntu-24.04 - awslc (push) Waiting to run
Build / gcc normal - ubuntu-24.04 - awslc (push) Waiting to run
Deploy Doxygen documentation to Pages / build (push) Waiting to run
Deploy Doxygen documentation to Pages / deploy (push) Blocked by required conditions
Some checks are pending
Build / Check code style with clang-format (push) Waiting to run
Build / Android - arm64-v8a (push) Waiting to run
Build / gcc-mingw - x64 - OSSL (push) Waiting to run
Build / gcc-mingw - x86 - OSSL (push) Waiting to run
Build / mingw unittest argv - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest auth_token - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest buffer - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest crypto - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest cryptoapi - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest misc - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest ncp - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest options_parse - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest packet_id - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest pkt - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest provider - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest ssl - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest tls_crypt - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest user_pass - x64 - OSSL (push) Blocked by required conditions
Build / mingw unittest argv - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest auth_token - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest buffer - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest crypto - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest cryptoapi - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest misc - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest ncp - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest options_parse - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest packet_id - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest pkt - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest provider - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest ssl - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest tls_crypt - x86 - OSSL (push) Blocked by required conditions
Build / mingw unittest user_pass - x86 - OSSL (push) Blocked by required conditions
Build / gcc - ubuntu-24.04 - OpenSSL 3.0.13 --enable-pkcs11 (push) Waiting to run
Build / gcc - ubuntu-22.04 - OpenSSL 3.0.2 --enable-pkcs11 (push) Waiting to run
Build / gcc - ubuntu-22.04 - mbed TLS (push) Waiting to run
Build / gcc - ubuntu-24.04 - mbed TLS (push) Waiting to run
Build / clang-asan - ubuntu-22.04 - mbedtls (push) Waiting to run
Build / clang-asan - ubuntu-22.04 - openssl (push) Waiting to run
Build / clang-asan - ubuntu-24.04 - mbedtls (push) Waiting to run
Build / clang-asan - ubuntu-24.04 - openssl (push) Waiting to run
Build / macos-13 - libressl - asan (push) Waiting to run
Build / macos-13 - openssl@1.1 - asan (push) Waiting to run
Build / macos-13 - openssl@3 - asan (push) Waiting to run
Build / macos-14 - libressl - asan (push) Waiting to run
Build / macos-14 - openssl@1.1 - asan (push) Waiting to run
Build / macos-14 - openssl@3 - asan (push) Waiting to run
Build / macos-15 - libressl - asan (push) Waiting to run
Build / macos-15 - openssl@1.1 - asan (push) Waiting to run
Build / macos-15 - openssl@3 - asan (push) Waiting to run
Build / macos-13 - libressl - normal (push) Waiting to run
Build / macos-13 - openssl@1.1 - normal (push) Waiting to run
Build / macos-13 - openssl@3 - normal (push) Waiting to run
Build / macos-14 - libressl - normal (push) Waiting to run
Build / macos-14 - openssl@1.1 - normal (push) Waiting to run
Build / macos-14 - openssl@3 - normal (push) Waiting to run
Build / macos-15 - libressl - normal (push) Waiting to run
Build / macos-15 - openssl@1.1 - normal (push) Waiting to run
Build / macos-15 - openssl@3 - normal (push) Waiting to run
Build / msbuild - amd64 - openssl (push) Waiting to run
Build / msbuild - amd64-clang - openssl (push) Waiting to run
Build / msbuild - arm64 - openssl (push) Waiting to run
Build / msbuild - x86 - openssl (push) Waiting to run
Build / msbuild - x86-clang - openssl (push) Waiting to run
Build / clang asan - ubuntu-22.04 - libressl (push) Waiting to run
Build / gcc normal - ubuntu-22.04 - libressl (push) Waiting to run
Build / clang asan - ubuntu-22.04 - mbedtls3 (push) Waiting to run
Build / gcc normal - ubuntu-22.04 - mbedtls3 (push) Waiting to run
Build / clang asan - ubuntu-24.04 - awslc (push) Waiting to run
Build / gcc normal - ubuntu-24.04 - awslc (push) Waiting to run
Deploy Doxygen documentation to Pages / build (push) Waiting to run
Deploy Doxygen documentation to Pages / deploy (push) Blocked by required conditions
Change-Id: I750a0b8107baa77fb14558d0c8e4ef8020d62efd Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com> Acked-by: Gert Doering <gert@greenie.muc.de> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1310 Message-Id: <20251030182922.26448-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34054.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
This commit is contained in:
parent
3e63c01a85
commit
cd4cac1655
4 changed files with 8 additions and 8 deletions
|
|
@ -608,14 +608,14 @@ man_kill(struct management *man, const char *victim)
|
|||
if (status)
|
||||
{
|
||||
const int port = atoi(p3);
|
||||
const int proto = (streq(p1, "tcp")) ? PROTO_TCP_SERVER
|
||||
: (streq(p1, "udp")) ? PROTO_UDP
|
||||
: PROTO_NONE;
|
||||
const uint8_t proto = (streq(p1, "tcp")) ? PROTO_TCP_SERVER
|
||||
: (streq(p1, "udp")) ? PROTO_UDP
|
||||
: PROTO_NONE;
|
||||
|
||||
if ((port > 0 && port < 65536) && (proto != PROTO_NONE))
|
||||
if ((port > 0 && port < UINT16_MAX) && (proto != PROTO_NONE))
|
||||
{
|
||||
n_killed = (*man->persist.callback.kill_by_addr)(man->persist.callback.arg,
|
||||
addr, port, proto);
|
||||
addr, (uint16_t)port, proto);
|
||||
if (n_killed > 0)
|
||||
{
|
||||
msg(M_CLIENT, "SUCCESS: %d client(s) at address %s:%s:%d killed", n_killed,
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ struct management_callback
|
|||
void (*status)(void *arg, const int version, struct status_output *so);
|
||||
void (*show_net)(void *arg, const msglvl_t msglevel);
|
||||
int (*kill_by_cn)(void *arg, const char *common_name);
|
||||
int (*kill_by_addr)(void *arg, const in_addr_t addr, const int port, const int proto);
|
||||
int (*kill_by_addr)(void *arg, const in_addr_t addr, const uint16_t port, const uint8_t proto);
|
||||
void (*delete_event)(void *arg, event_t event);
|
||||
int (*n_clients)(void *arg);
|
||||
bool (*send_cc_message)(void *arg, const char *message, const char *parameter);
|
||||
|
|
|
|||
|
|
@ -3937,7 +3937,7 @@ management_callback_kill_by_cn(void *arg, const char *del_cn)
|
|||
}
|
||||
|
||||
static int
|
||||
management_callback_kill_by_addr(void *arg, const in_addr_t addr, const int port, const int proto)
|
||||
management_callback_kill_by_addr(void *arg, const in_addr_t addr, const uint16_t port, const uint8_t proto)
|
||||
{
|
||||
struct multi_context *m = (struct multi_context *)arg;
|
||||
struct hash_iterator hi;
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ struct link_socket_info
|
|||
const char *ipchange_command;
|
||||
const struct plugin_list *plugins;
|
||||
bool remote_float;
|
||||
int proto; /* Protocol (PROTO_x defined below) */
|
||||
uint8_t proto; /* Protocol (PROTO_x defined below) */
|
||||
sa_family_t af; /* Address family like AF_INET, AF_INET6 or AF_UNSPEC*/
|
||||
bool bind_ipv6_only;
|
||||
int mtu_changed; /* Set to true when mtu value is changed */
|
||||
|
|
|
|||
Loading…
Reference in a new issue