diff --git a/src/neigh.c b/src/neigh.c index 621f5e93e6471f35934af8f10b6766f917a1b4be..96662c5bd743f3363139458fdab8666257c8b3c2 100644 --- a/src/neigh.c +++ b/src/neigh.c @@ -1101,7 +1101,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 d0fe8d1ac8782816aa1cb4c4b9c17e496d608714..3190debd5277d2e7ffb804c32f966995bed31e3f 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 48e26dcd7e4f838c7269e8d6c2af2e3946d06c5b..69faa071be0c216c1425b4b2239e7d8cc0321b38 100644 --- a/src/ubus.c +++ b/src/ubus.c @@ -429,7 +429,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; @@ -1285,7 +1285,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;