mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
netlink: make failure to bind nonfatal
This commit is contained in:
parent
4844ff872b
commit
b746a2c75a
2 changed files with 9 additions and 5 deletions
|
@ -130,7 +130,9 @@ lws_state_notify_protocol_init(struct lws_state_manager *mgr,
|
|||
* us to OPERATIONAL
|
||||
*/
|
||||
|
||||
if (target == LWS_SYSTATE_IFACE_COLDPLUG && !context->nl_initial_done) {
|
||||
if (target == LWS_SYSTATE_IFACE_COLDPLUG &&
|
||||
context->netlink &&
|
||||
!context->nl_initial_done) {
|
||||
lwsl_info("%s: waiting for netlink coldplug\n", __func__);
|
||||
|
||||
return 1;
|
||||
|
|
|
@ -480,7 +480,7 @@ rops_pt_init_destroy_netlink(struct lws_context *context,
|
|||
struct msghdr msg;
|
||||
struct iovec iov;
|
||||
struct lws *wsi;
|
||||
int n;
|
||||
int n, ret = 1;
|
||||
|
||||
if (destroy) {
|
||||
|
||||
|
@ -533,8 +533,10 @@ rops_pt_init_destroy_netlink(struct lws_context *context,
|
|||
#endif
|
||||
;
|
||||
|
||||
if (bind(wsi->desc.sockfd, (struct sockaddr*)&sanl, sizeof(sanl)) < 0) {
|
||||
lwsl_err("%s: netlink bind failed\n", __func__);
|
||||
if (lws_fi(&context->fic, "netlink_bind") ||
|
||||
bind(wsi->desc.sockfd, (struct sockaddr*)&sanl, sizeof(sanl)) < 0) {
|
||||
lwsl_warn("%s: netlink bind failed\n", __func__);
|
||||
ret = 0; /* some systems deny access, just ignore */
|
||||
goto bail2;
|
||||
}
|
||||
|
||||
|
@ -600,7 +602,7 @@ bail2:
|
|||
bail1:
|
||||
lws_free(wsi);
|
||||
bail:
|
||||
return 1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const lws_rops_t rops_table_netlink[] = {
|
||||
|
|
Loading…
Add table
Reference in a new issue