Bug 4213 - nsd-4.1.26: --enable-dnstap --disable-ipv6: dnstap/dnstap.c:322:10: error: ‘struct sockaddr_in’ has no member named ‘ss_fami ly’
nsd-4.1.26: --enable-dnstap --disable-ipv6: dnstap/dnstap.c:322:10: error: ‘s...
Status: RESOLVED FIXED
Product: NSD
Classification: Unclassified
Component: NSD Code
4.1.x
x86_64 Linux
: P5 enhancement
Assigned To: NSD team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-12-05 11:07 CET by Lars Wendler
Modified: 2018-12-05 11:12 CET (History)
1 user (show)

See Also:


Attachments
build.log (16.28 KB, text/x-log)
2018-12-05 11:07 CET, Lars Wendler
Details
build.log (15.14 KB, text/plain)
2018-12-05 11:09 CET, Lars Wendler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Wendler 2018-12-05 11:07:39 CET
Created attachment 536 [details]
build.log

Hi,

while doing some compile testing of the new dnstap feature I stumbled upon the following compile error when running configure with --enable-dnstap --disable-ipv6 before:

x86_64-pc-linux-gnu-gcc -I. -march=native -mtune=native -O2 -pipe -I/usr/include/google -c dnstap/dnstap.c
dnstap/dnstap.c: In function ‘dt_msg_fill_net’:
dnstap/dnstap.c:322:10: error: ‘struct sockaddr_in’ has no member named ‘ss_family’; did you mean ‘sin_family’?
  if (ss->ss_family == AF_INET) {
          ^~~~~~~~~
          sin_family
make: *** [Makefile:89: dnstap.o] Error 1


I've attached the full build log in case you need more information.
Comment 1 Lars Wendler 2018-12-05 11:09:58 CET
Created attachment 537 [details]
build.log

build.log without ANSI color codes.
Comment 2 Wouter Wijngaards 2018-12-05 11:12:49 CET
Hi Lars,

Thanks for the information, the fix is below and also in the code repository.

Best regards, Wouter

Index: dnstap/dnstap.c
===================================================================
--- dnstap/dnstap.c	(revision 4948)
+++ dnstap/dnstap.c	(working copy)
@@ -319,7 +319,7 @@
 		*has_port = 1;
 	} else if (ss->ss_family == AF_INET) {
 #else
-	if (ss->ss_family == AF_INET) {
+	if (ss->sin_family == AF_INET) {
 #endif /* INET6 */
 		struct sockaddr_in *s = (struct sockaddr_in *) ss;