struct sockaddr_storage my_addr;
struct sockaddr_storage addr;
bool bcast;
+ bool bcast_star_query;
uint8_t buf[1024];
nmb->header.nscount = 0;
nmb->header.arcount = 0;
+ if (bcast && (strcmp(name, "*")==0)) {
+ /*
+ * We're doing a broadcast query for all
+ * names in the area. Remember this so
+ * we will wait for all names within
+ * the timeout period.
+ */
+ state->bcast_star_query = true;
+ }
+
make_nmb_name(&nmb->question.question_name,name,name_type);
nmb->question.question_type = 0x20;
if (state->bcast) {
/*
* We have to collect all entries coming in from broadcast
- * queries. If we got a unique name, we're done.
+ * queries. If we got a unique name and we are not querying
+ * all names registered within broadcast area (query
+ * for the name '*', so state->bcast_star_query is set),
+ * we're done.
*/
- return got_unique_netbios_name;
+ return (got_unique_netbios_name && !state->bcast_star_query);
}
/*
* WINS responses are accepted when they are received