kernel-netlink: Always register for events
The starter-specific code path isn't necessary anymore since
d8fdd1018e ("starter: Don't flush SAs in the kernel").
This commit is contained in:
@@ -3764,7 +3764,7 @@ static void setup_spd_hash_thresh(private_kernel_netlink_ipsec_t *this,
|
|||||||
kernel_netlink_ipsec_t *kernel_netlink_ipsec_create()
|
kernel_netlink_ipsec_t *kernel_netlink_ipsec_create()
|
||||||
{
|
{
|
||||||
private_kernel_netlink_ipsec_t *this;
|
private_kernel_netlink_ipsec_t *this;
|
||||||
bool register_for_events = TRUE;
|
struct sockaddr_nl addr;
|
||||||
|
|
||||||
INIT(this,
|
INIT(this,
|
||||||
.public = {
|
.public = {
|
||||||
@@ -3804,11 +3804,6 @@ kernel_netlink_ipsec_t *kernel_netlink_ipsec_create()
|
|||||||
FALSE, lib->ns),
|
FALSE, lib->ns),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (streq(lib->ns, "starter"))
|
|
||||||
{ /* starter has no threads, so we do not register for kernel events */
|
|
||||||
register_for_events = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
this->socket_xfrm = netlink_socket_create(NETLINK_XFRM, xfrm_msg_names,
|
this->socket_xfrm = netlink_socket_create(NETLINK_XFRM, xfrm_msg_names,
|
||||||
lib->settings->get_bool(lib->settings,
|
lib->settings->get_bool(lib->settings,
|
||||||
"%s.plugins.kernel-netlink.parallel_xfrm", FALSE, lib->ns));
|
"%s.plugins.kernel-netlink.parallel_xfrm", FALSE, lib->ns));
|
||||||
@@ -3821,10 +3816,6 @@ kernel_netlink_ipsec_t *kernel_netlink_ipsec_create()
|
|||||||
setup_spd_hash_thresh(this, "ipv4", XFRMA_SPD_IPV4_HTHRESH, 32);
|
setup_spd_hash_thresh(this, "ipv4", XFRMA_SPD_IPV4_HTHRESH, 32);
|
||||||
setup_spd_hash_thresh(this, "ipv6", XFRMA_SPD_IPV6_HTHRESH, 128);
|
setup_spd_hash_thresh(this, "ipv6", XFRMA_SPD_IPV6_HTHRESH, 128);
|
||||||
|
|
||||||
if (register_for_events)
|
|
||||||
{
|
|
||||||
struct sockaddr_nl addr;
|
|
||||||
|
|
||||||
memset(&addr, 0, sizeof(addr));
|
memset(&addr, 0, sizeof(addr));
|
||||||
addr.nl_family = AF_NETLINK;
|
addr.nl_family = AF_NETLINK;
|
||||||
|
|
||||||
@@ -3848,7 +3839,6 @@ kernel_netlink_ipsec_t *kernel_netlink_ipsec_create()
|
|||||||
}
|
}
|
||||||
lib->watcher->add(lib->watcher, this->socket_xfrm_events, WATCHER_READ,
|
lib->watcher->add(lib->watcher, this->socket_xfrm_events, WATCHER_READ,
|
||||||
(watcher_cb_t)receive_events, this);
|
(watcher_cb_t)receive_events, this);
|
||||||
}
|
|
||||||
|
|
||||||
netlink_find_offload_feature(lib->settings->get_str(lib->settings,
|
netlink_find_offload_feature(lib->settings->get_str(lib->settings,
|
||||||
"%s.plugins.kernel-netlink.hw_offload_feature_interface",
|
"%s.plugins.kernel-netlink.hw_offload_feature_interface",
|
||||||
|
|||||||
@@ -3096,7 +3096,7 @@ kernel_netlink_net_t *kernel_netlink_net_create()
|
|||||||
{
|
{
|
||||||
private_kernel_netlink_net_t *this;
|
private_kernel_netlink_net_t *this;
|
||||||
enumerator_t *enumerator;
|
enumerator_t *enumerator;
|
||||||
bool register_for_events = TRUE;
|
struct sockaddr_nl addr;
|
||||||
char *exclude;
|
char *exclude;
|
||||||
|
|
||||||
INIT(this,
|
INIT(this,
|
||||||
@@ -3168,11 +3168,6 @@ kernel_netlink_net_t *kernel_netlink_net_create()
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (streq(lib->ns, "starter"))
|
|
||||||
{ /* starter has no threads, so we do not register for kernel events */
|
|
||||||
register_for_events = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
exclude = lib->settings->get_str(lib->settings,
|
exclude = lib->settings->get_str(lib->settings,
|
||||||
"%s.ignore_routing_tables", NULL, lib->ns);
|
"%s.ignore_routing_tables", NULL, lib->ns);
|
||||||
if (exclude)
|
if (exclude)
|
||||||
@@ -3194,10 +3189,6 @@ kernel_netlink_net_t *kernel_netlink_net_create()
|
|||||||
enumerator->destroy(enumerator);
|
enumerator->destroy(enumerator);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (register_for_events)
|
|
||||||
{
|
|
||||||
struct sockaddr_nl addr;
|
|
||||||
|
|
||||||
memset(&addr, 0, sizeof(addr));
|
memset(&addr, 0, sizeof(addr));
|
||||||
addr.nl_family = AF_NETLINK;
|
addr.nl_family = AF_NETLINK;
|
||||||
|
|
||||||
@@ -3230,10 +3221,8 @@ kernel_netlink_net_t *kernel_netlink_net_create()
|
|||||||
destroy(this);
|
destroy(this);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
lib->watcher->add(lib->watcher, this->socket_events, WATCHER_READ,
|
lib->watcher->add(lib->watcher, this->socket_events, WATCHER_READ,
|
||||||
(watcher_cb_t)receive_events, this);
|
(watcher_cb_t)receive_events, this);
|
||||||
}
|
|
||||||
|
|
||||||
if (init_address_list(this) != SUCCESS)
|
if (init_address_list(this) != SUCCESS)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user