diff --git a/Makefile.bsd b/Makefile.bsd new file mode 100644 index 0000000..63064f7 --- /dev/null +++ b/Makefile.bsd @@ -0,0 +1,8 @@ +CFLAGS ?= -Wall -fPIC -ggdb -O2 $(OPTS) $(INCLUDE) $(DEFINES) +LDFLAGS ?= -s -lpthread -lcrypto -lm -lrt -lz -L. + +OBJ = bin/bsd +EXECUTABLE = bin/tinysvcmdns-bsd + +include Makefile + diff --git a/bin/tinysvcmdns-bsd b/bin/tinysvcmdns-bsd new file mode 100644 index 0000000..49622a2 Binary files /dev/null and b/bin/tinysvcmdns-bsd differ diff --git a/bin/tinysvcmdns.exe b/bin/tinysvcmdns.exe index 63e738b..07dfbe6 100644 Binary files a/bin/tinysvcmdns.exe and b/bin/tinysvcmdns.exe differ diff --git a/mdnsd.c b/mdnsd.c index 89434c3..a3e5e7a 100644 --- a/mdnsd.c +++ b/mdnsd.c @@ -123,7 +123,7 @@ static int create_recv_sock(uint32_t host) { return r; } -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(__FreeBSD__) if ((r = setsockopt(sd, SOL_SOCKET, SO_REUSEPORT,(char*) &on, sizeof(on))) < 0) { log_message(LOG_ERR, "recv setsockopt(SO_REUSEPORT): %m"); } @@ -695,7 +695,7 @@ struct mdns_service *mdnsd_register_svc(struct mdnsd *svr, const char *instance_ void mdns_service_remove(struct mdnsd *svr, struct mdns_service *svc) { struct rr_list *rr; - assert(srv != NULL && svc != NULL); + assert(svr != NULL && svc != NULL); // modify lists here pthread_mutex_lock(&svr->data_lock);