forked from acouzens/open5gs
Change default to bindtodevice:false
This commit is contained in:
parent
914bb0a40f
commit
c1fc25958c
|
@ -290,7 +290,7 @@ pool:
|
|||
#
|
||||
# sockopt:
|
||||
# no_delay : true
|
||||
# so_bindtodevice : true
|
||||
# bindtodevice : false
|
||||
#
|
||||
sockopt:
|
||||
|
||||
|
|
|
@ -388,7 +388,7 @@ pool:
|
|||
#
|
||||
# sockopt:
|
||||
# no_delay : true
|
||||
# so_bindtodevice : true
|
||||
# bindtodevice : false
|
||||
#
|
||||
sockopt:
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ pool:
|
|||
|
||||
#
|
||||
# sockopt:
|
||||
# so_bindtodevice : true
|
||||
# bindtodevice : false
|
||||
#
|
||||
sockopt:
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@ pool:
|
|||
#
|
||||
# sockopt:
|
||||
# no_delay : true
|
||||
# so_bindtodevice : true
|
||||
# bindtodevice : false
|
||||
#
|
||||
sockopt:
|
||||
|
||||
|
|
|
@ -500,7 +500,7 @@ pool:
|
|||
|
||||
#
|
||||
# sockopt:
|
||||
# so_bindtodevice : true
|
||||
# bindtodevice : false
|
||||
#
|
||||
sockopt:
|
||||
|
||||
|
|
|
@ -222,7 +222,7 @@ pool:
|
|||
|
||||
#
|
||||
# sockopt:
|
||||
# so_bindtodevice : true
|
||||
# bindtodevice : false
|
||||
#
|
||||
sockopt:
|
||||
|
||||
|
|
|
@ -187,7 +187,7 @@ static void app_context_prepare(void)
|
|||
self.sctp.max_initial_timeout = 8000; /* 8 seconds */
|
||||
|
||||
self.sockopt.no_delay = true;
|
||||
self.sockopt.so_bindtodevice = true;
|
||||
self.sockopt.bindtodevice = false;
|
||||
|
||||
#define MAX_NUM_OF_UE 1024 /* Num of UE per AMF/MME */
|
||||
#define MAX_NUM_OF_GNB 64 /* Num of gNB per AMF/MME */
|
||||
|
@ -377,8 +377,8 @@ int ogs_app_context_parse_config(void)
|
|||
const char *v = ogs_yaml_iter_value(&sockopt_iter);
|
||||
if (v) self.sockopt.l_linger = atoi(v);
|
||||
self.sockopt.l_onoff = true;
|
||||
} else if (!strcmp(sockopt_key, "so_bindtodevice")) {
|
||||
self.sockopt.so_bindtodevice =
|
||||
} else if (!strcmp(sockopt_key, "bindtodevice")) {
|
||||
self.sockopt.bindtodevice =
|
||||
ogs_yaml_iter_bool(&sockopt_iter);
|
||||
} else
|
||||
ogs_warn("unknown key `%s`", sockopt_key);
|
||||
|
|
|
@ -84,7 +84,7 @@ typedef struct ogs_app_context_s {
|
|||
int no_delay;
|
||||
int l_onoff;
|
||||
int l_linger;
|
||||
int so_bindtodevice;
|
||||
int bindtodevice;
|
||||
} sockopt;
|
||||
|
||||
struct {
|
||||
|
|
|
@ -347,7 +347,7 @@ int ogs_bind_to_device(ogs_socket_t fd, const char *device)
|
|||
ogs_error("OR disable SO_BINDTODEVICE "
|
||||
"in the configuration file as below.");
|
||||
ogs_log_print(OGS_LOG_ERROR, "\nsockopt:\n");
|
||||
ogs_log_print(OGS_LOG_ERROR, " so_bindtodevice : false\n\n");
|
||||
ogs_log_print(OGS_LOG_ERROR, " bindtodevice : false\n\n");
|
||||
return OGS_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -33,7 +33,7 @@ ogs_sock_t *ogs_udp_socket(int family, ogs_socknode_t *node)
|
|||
return sock;
|
||||
}
|
||||
|
||||
ogs_sock_t *ogs_udp_server(ogs_socknode_t *node, bool so_bindtodevice)
|
||||
ogs_sock_t *ogs_udp_server(ogs_socknode_t *node, bool bindtodevice)
|
||||
{
|
||||
ogs_sock_t *new = NULL;
|
||||
ogs_sockaddr_t *addr;
|
||||
|
@ -55,7 +55,7 @@ ogs_sock_t *ogs_udp_server(ogs_socknode_t *node, bool so_bindtodevice)
|
|||
continue;
|
||||
}
|
||||
ogs_debug("udp_server() [%s]:%d", OGS_ADDR(addr, buf), OGS_PORT(addr));
|
||||
if (so_bindtodevice == true && node->dev) {
|
||||
if (bindtodevice == true && node->dev) {
|
||||
if (ogs_bind_to_device(new->fd, node->dev) != OGS_OK) {
|
||||
ogs_sock_destroy(new);
|
||||
addr = addr->next;
|
||||
|
|
|
@ -29,7 +29,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
ogs_sock_t *ogs_udp_socket(int family, ogs_socknode_t *node);
|
||||
ogs_sock_t *ogs_udp_server(ogs_socknode_t *node, bool so_bindtodevice);
|
||||
ogs_sock_t *ogs_udp_server(ogs_socknode_t *node, bool bindtodevice);
|
||||
ogs_sock_t *ogs_udp_client(ogs_socknode_t *node);
|
||||
int ogs_udp_connect(ogs_sock_t *sock, ogs_sockaddr_t *sa_list);
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ ogs_sock_t *ogs_gtp_server(ogs_socknode_t *node)
|
|||
ogs_sock_t *gtp;
|
||||
ogs_assert(node);
|
||||
|
||||
gtp = ogs_udp_server(node, ogs_app()->sockopt.so_bindtodevice);
|
||||
gtp = ogs_udp_server(node, ogs_app()->sockopt.bindtodevice);
|
||||
if (gtp) {
|
||||
ogs_info("gtp_server() [%s]:%d",
|
||||
OGS_ADDR(node->addr, buf), OGS_PORT(node->addr));
|
||||
|
|
|
@ -25,7 +25,7 @@ ogs_sock_t *ogs_pfcp_server(ogs_socknode_t *node)
|
|||
ogs_sock_t *pfcp;
|
||||
ogs_assert(node);
|
||||
|
||||
pfcp = ogs_udp_server(node, ogs_app()->sockopt.so_bindtodevice);
|
||||
pfcp = ogs_udp_server(node, ogs_app()->sockopt.bindtodevice);
|
||||
if (pfcp) {
|
||||
ogs_info("pfcp_server() [%s]:%d",
|
||||
OGS_ADDR(node->addr, buf), OGS_PORT(node->addr));
|
||||
|
|
Loading…
Reference in New Issue