mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-08-20 05:23:12 -07:00
Fix Regist Search Non-Broadcast Send (Fix #11)
This commit is contained in:
parent
9a006423bf
commit
bd79895015
1 changed files with 5 additions and 1 deletions
|
@ -276,7 +276,11 @@ static ChiakiErrorCode regist_search(ChiakiRegist *regist, struct addrinfo *addr
|
||||||
ChiakiErrorCode err = CHIAKI_ERR_SUCCESS;
|
ChiakiErrorCode err = CHIAKI_ERR_SUCCESS;
|
||||||
|
|
||||||
CHIAKI_LOGI(regist->log, "Regist sending search packet");
|
CHIAKI_LOGI(regist->log, "Regist sending search packet");
|
||||||
int r = sendto_broadcast(regist->log, sock, "SRC2", 4, 0, &send_addr, send_addr_len);
|
int r;
|
||||||
|
if(regist->info.broadcast)
|
||||||
|
r = sendto_broadcast(regist->log, sock, "SRC2", 4, 0, &send_addr, send_addr_len);
|
||||||
|
else
|
||||||
|
r = send(sock, "SRC2", 4, 0);
|
||||||
if(r < 0)
|
if(r < 0)
|
||||||
{
|
{
|
||||||
CHIAKI_LOGE(regist->log, "Regist failed to send search: %s", strerror(errno));
|
CHIAKI_LOGE(regist->log, "Regist failed to send search: %s", strerror(errno));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue