diff --git a/src/neigh.c b/src/neigh.c index cc99ae2e026e6ee0fb0e1d8ac4b2c65b04d79630..9560dd725f98ac9b4cf36578d1585e3a1c8051d0 100644 --- a/src/neigh.c +++ b/src/neigh.c @@ -1103,7 +1103,7 @@ void hostmngr_get_wifi_stations(struct hostmngr_private *priv, neigh_history_enqueue(priv, new, priv->cfg.history_ageout); - if (!ipaddr_is_zero(&new->ipv4)) + if (!ipaddr_is_zero(&new->ipv4) && (!new->ipv4_type_dhcp || strlen(new->hostname))) hostmngr_host_event(priv, HOST_EVENT_CONNECT, new); else new->event_pending = 1; diff --git a/src/netlink.c b/src/netlink.c index 42d8e153aede897c68effc7908e1751ec0a6754a..c7cc29e1f92c01e66bf274a234043601a4c6755b 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -202,7 +202,7 @@ static int hostmngr_handle_neigh_tbl_change(struct hostmngr_private *priv, bool return 0; } - if (e->event_pending && !ipaddr_is_zero(&e->ipv4)) { + if (e->event_pending && !ipaddr_is_zero(&e->ipv4) && strlen(e->hostname)) { e->event_pending = 0; hostmngr_host_event(priv, HOST_EVENT_CONNECT, e); } diff --git a/src/ubus.c b/src/ubus.c index 66095e305a03d2459751e792468b237fc8048235..359b810b775f23bea4d1c41694e43903de15e396 100644 --- a/src/ubus.c +++ b/src/ubus.c @@ -426,7 +426,7 @@ static void hostmngr_1905topology_cb(struct ubus_request *req, int type, neigh_history_enqueue(priv, rn, priv->cfg.history_ageout); - if (!ipaddr_is_zero(&rn->ipv4)) + if (!ipaddr_is_zero(&rn->ipv4) && (!rn->ipv4_type_dhcp || strlen(rn->hostname))) hostmngr_host_event(priv, HOST_EVENT_CONNECT, rn); else rn->event_pending = 1; @@ -1282,7 +1282,7 @@ static void hostmngr_wifi_sta_event_handler(struct hostmngr_private *p, neigh_history_enqueue(p, new, p->cfg.history_ageout); - if (!ipaddr_is_zero(&new->ipv4)) + if (!ipaddr_is_zero(&new->ipv4) && (!new->ipv4_type_dhcp || strlen(new->hostname))) hostmngr_host_event(p, HOST_EVENT_CONNECT, new); else new->event_pending = 1;