diff --git a/protocol1_discovery.c b/protocol1_discovery.c index 7d833c7..43bf53e 100644 --- a/protocol1_discovery.c +++ b/protocol1_discovery.c @@ -117,7 +117,7 @@ static void discover(struct ifaddrs* iface) { if(sendto(discovery_socket,buffer,63,0,(struct sockaddr*)&to_addr,sizeof(to_addr))<0) { perror("discover: sendto socket failed for discovery_socket\n"); - if(errno!=EHOSTUNREACH && errno!=EADDRNOTAVAIL) { + if(errno!=EHOSTUNREACH && errno!=EADDRNOTAVAIL && errno!=ENOKEY) { exit(-1); } } diff --git a/protocol2_discovery.c b/protocol2_discovery.c index 17cfe9c..46b8dfd 100644 --- a/protocol2_discovery.c +++ b/protocol2_discovery.c @@ -168,7 +168,7 @@ void protocol2_discover(struct ifaddrs* iface) { if(sendto(discovery_socket,buffer,60,0,(struct sockaddr*)&to_addr,sizeof(to_addr))<0) { perror("protocol2_discover: sendto socket failed for discovery_socket\n"); - if(errno!=EHOSTUNREACH) { + if(errno!=EHOSTUNREACH && errno!=ENOKEY) { exit(-1); } }