mirror of
https://github.com/amnezia-vpn/amneziawg-tools.git
synced 2025-09-06 17:12:53 +02:00
fix: showconf
Some checks failed
Some checks failed
This commit is contained in:
parent
ed0244262d
commit
09db5f7cb3
3 changed files with 11 additions and 11 deletions
|
@ -53,12 +53,12 @@ enum wgdevice_attribute {
|
||||||
WGDEVICE_A_JMAX,
|
WGDEVICE_A_JMAX,
|
||||||
WGDEVICE_A_S1,
|
WGDEVICE_A_S1,
|
||||||
WGDEVICE_A_S2,
|
WGDEVICE_A_S2,
|
||||||
WGDEVICE_A_S3,
|
|
||||||
WGDEVICE_A_S4,
|
|
||||||
WGDEVICE_A_H1,
|
WGDEVICE_A_H1,
|
||||||
WGDEVICE_A_H2,
|
WGDEVICE_A_H2,
|
||||||
WGDEVICE_A_H3,
|
WGDEVICE_A_H3,
|
||||||
WGDEVICE_A_H4,
|
WGDEVICE_A_H4,
|
||||||
|
WGDEVICE_A_S3,
|
||||||
|
WGDEVICE_A_S4,
|
||||||
WGDEVICE_A_I1,
|
WGDEVICE_A_I1,
|
||||||
WGDEVICE_A_I2,
|
WGDEVICE_A_I2,
|
||||||
WGDEVICE_A_I3,
|
WGDEVICE_A_I3,
|
||||||
|
|
|
@ -421,7 +421,7 @@ err:
|
||||||
static inline bool parse_awg_string(char **device_value, const char *name, const char *value) {
|
static inline bool parse_awg_string(char **device_value, const char *name, const char *value) {
|
||||||
size_t len = strlen(value);
|
size_t len = strlen(value);
|
||||||
if (!len) {
|
if (!len) {
|
||||||
*device_value = "";
|
*device_value = NULL;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,14 +36,7 @@ void put_magic_header_attr(struct nlmsghdr *nlh, int attr_name, char *header_fie
|
||||||
}
|
}
|
||||||
|
|
||||||
#define GET_MAGIC_HEADER(attr, magic_header, attr_name)\
|
#define GET_MAGIC_HEADER(attr, magic_header, attr_name)\
|
||||||
if (!mnl_attr_validate(attr, MNL_TYPE_STRING)) {\
|
if (!mnl_attr_validate(attr, MNL_TYPE_U32)) {\
|
||||||
magic_header = strdup(mnl_attr_get_str(attr));\
|
|
||||||
if (!magic_header) {\
|
|
||||||
perror("strdup");\
|
|
||||||
return MNL_CB_ERROR;\
|
|
||||||
}\
|
|
||||||
device->flags |= attr_name;\
|
|
||||||
} else if (!mnl_attr_validate(attr, MNL_TYPE_U32)) {\
|
|
||||||
uint32_t numeric_value = mnl_attr_get_u32(attr);\
|
uint32_t numeric_value = mnl_attr_get_u32(attr);\
|
||||||
magic_header = malloc(12);\
|
magic_header = malloc(12);\
|
||||||
if (!magic_header) {\
|
if (!magic_header) {\
|
||||||
|
@ -52,6 +45,13 @@ void put_magic_header_attr(struct nlmsghdr *nlh, int attr_name, char *header_fie
|
||||||
}\
|
}\
|
||||||
snprintf(magic_header, 12, "%u", numeric_value);\
|
snprintf(magic_header, 12, "%u", numeric_value);\
|
||||||
device->flags |= attr_name;\
|
device->flags |= attr_name;\
|
||||||
|
} else if (!mnl_attr_validate(attr, MNL_TYPE_STRING)) {\
|
||||||
|
magic_header = strdup(mnl_attr_get_str(attr));\
|
||||||
|
if (!magic_header) {\
|
||||||
|
perror("strdup");\
|
||||||
|
return MNL_CB_ERROR;\
|
||||||
|
}\
|
||||||
|
device->flags |= attr_name;\
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SOCKET_BUFFER_SIZE (mnl_ideal_socket_buffer_size())
|
#define SOCKET_BUFFER_SIZE (mnl_ideal_socket_buffer_size())
|
||||||
|
|
Loading…
Add table
Reference in a new issue