Commit Diff
Diff:
c1028ad7b2f2d11757a484c8438076e8bdb90c91
2cb482ccaf63183116eb6f8aa9d5c51e6ed93ce6
Commit:
2cb482ccaf63183116eb6f8aa9d5c51e6ed93ce6
Tree:
fd11a0bce692f0edb19e462eb754f59d3e7a1c64
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Fri Jul 13 02:40:59 2018 UTC
Message:
Silence warnings, also CMSG_DATA() by now is unsigned char across all platforms (it once was different, or I didn't need the #ifdef's), remove ifdefs around CMSG_DATA()
blob - e5b16ea11aecfd09fc141f66728b35e10ea54984
blob + 5c462ed8f7dd394640af9b3ac1ed6386254818ec
--- Makefile.linux
+++ Makefile.linux
@@ -1,6 +1,6 @@
CC=gcc
#CFLAGS=-DDEBUG
-CFLAGS=
+CFLAGS=-D_XOPEN_SOURCE -D_DEFAULT_SOURCE
LDADD= -lresolv -lcrypto -lrt -lbsd
YACC=bison
AR=ar
@@ -28,7 +28,7 @@ dddctl.o: dddctl.c
$(CC) $(CFLAGS) -c dddctl.c
parse.o: parse.y
- $(YACC) $(CFLAGS) -y -d parse.y
+ $(YACC) $(BISONCFLAGS) -y -d parse.y
mv -f y.tab.c parse.c
$(CC) $(CFLAGS) -c parse.c
blob - 7990ec1672f134d38796b043709cb7528c426c30
blob + 499b04b27d46c25ceecb097577f6a072ca32d335
--- delphinusdnsd.c
+++ delphinusdnsd.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: delphinusdnsd.c,v 1.37 2018/07/12 07:53:02 pjp Exp $
+ * $Id: delphinusdnsd.c,v 1.38 2018/07/13 02:40:59 pjp Exp $
*/
#include "ddd-include.h"
@@ -1550,12 +1550,8 @@ mainloop(struct cfg *cfg, struct imsgbuf **ibuf)
int lfd;
int idata;
- u_int32_t received_ttl;
-#if defined __FreeBSD__ || defined __OpenBSD__
+ u_int32_t received_ttl;
u_char *ttlptr;
-#else
- int *ttlptr;
-#endif
u_int8_t aregion; /* region where the address comes from */
@@ -1770,15 +1766,8 @@ axfrentry:
&& cmsg->cmsg_type == IP_RECVTTL) {
#endif
-#if defined __FreeBSD__ || defined __OpenBSD__
-
ttlptr = (u_char *) CMSG_DATA(cmsg);
received_ttl = (u_int)*ttlptr;
-#else
-
- ttlptr = (int *) CMSG_DATA(cmsg);
- received_ttl = (u_int)*ttlptr;
-#endif
}
if (cmsg->cmsg_level == IPPROTO_IPV6 &&
@@ -1790,11 +1779,7 @@ axfrentry:
continue;
}
-#ifdef __NetBSD__
- ttlptr = (int *) CMSG_DATA(cmsg);
-#else
ttlptr = (u_char *) CMSG_DATA(cmsg);
-#endif
received_ttl = (u_int)*ttlptr;
}
}
repomaster@centroid.eu