trafd doesn't build with clang.
===> Cleaning for trafd-3.0.1
===> Verifying specs: c pcap
===> found c.89.4 pcap.8.3
===> Checking files for trafd-3.0.1
`/d/distfiles/trafd-3.0.1.tgz' is up to date.
>> (SHA256) trafd-3.0.1.tgz: OK
===> Extracting for trafd-3.0.1
===> Patching for trafd-3.0.1
===> Applying OpenBSD patch patch-Makefile
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|$OpenBSD: patch-Makefile,v 1.1.1.1 2000/09/15 05:17:40 form Exp $
|--- Makefile.orig Thu Nov 25 17:38:29 1999
|+++ Makefile Fri Sep 15 11:25:57 2000
--------------------------
Patching file Makefile using Plan A...
Hunk #1 succeeded at 12.
Hunk #2 succeeded at 35.
Hunk #3 succeeded at 64.
done
===> Applying OpenBSD patch patch-lib_addrtoname_c
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|$OpenBSD: patch-lib_addrtoname_c,v 1.1.1.1 2000/09/15 05:17:40 form Exp $
|--- lib/addrtoname.c.orig Fri Sep 15 11:30:42 2000
|+++ lib/addrtoname.c Fri Sep 15 11:30:55 2000
--------------------------
Patching file lib/addrtoname.c using Plan A...
Hunk #1 succeeded at 36.
done
===> Applying OpenBSD patch patch-lib_interfaces_c
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|$OpenBSD: patch-lib_interfaces_c,v 1.1.1.1 2000/09/15 05:17:40 form Exp $
|--- lib/interfaces.c.orig Fri Sep 15 11:31:00 2000
|+++ lib/interfaces.c Fri Sep 15 11:31:20 2000
--------------------------
Patching file lib/interfaces.c using Plan A...
Hunk #1 succeeded at 30.
Hunk #2 succeeded at 39.
done
===> Applying OpenBSD patch patch-trafd_trafd_h
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|$OpenBSD: patch-trafd_trafd_h,v 1.1 2010/05/22 15:08:52 espie Exp $
|--- trafd/trafd.h.orig Sat May 22 17:06:41 2010
|+++ trafd/trafd.h Sat May 22 17:06:56 2010
--------------------------
Patching file trafd/trafd.h using Plan A...
Hunk #1 succeeded at 25.
done
===> Applying OpenBSD patch patch-trafd_trafdump
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|$OpenBSD: patch-trafd_trafdump,v 1.1.1.1 2000/09/15 05:17:40 form Exp $
|--- trafd/trafdump.orig Thu Dec 9 19:53:56 1993
|+++ trafd/trafdump Fri Sep 15 11:23:19 2000
--------------------------
Patching file trafd/trafdump using Plan A...
Hunk #1 succeeded at 1.
done
===> Applying OpenBSD patch patch-trafd_traffic_c
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|$OpenBSD: patch-trafd_traffic_c,v 1.2 2010/05/22 15:08:52 espie Exp $
|--- trafd/traffic.c.orig Thu Nov 25 12:31:15 1999
|+++ trafd/traffic.c Sat May 22 17:06:25 2010
--------------------------
Patching file trafd/traffic.c using Plan A...
Hunk #1 succeeded at 31.
Hunk #2 succeeded at 215.
Hunk #3 succeeded at 225.
Hunk #4 succeeded at 262.
Hunk #5 succeeded at 272.
done
===> Applying OpenBSD patch patch-trafd_trafsave
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|$OpenBSD: patch-trafd_trafsave,v 1.1.1.1 2000/09/15 05:17:40 form Exp $
|--- trafd/trafsave.orig Sat Nov 6 17:37:30 1993
|+++ trafd/trafsave Fri Sep 15 11:23:19 2000
--------------------------
Patching file trafd/trafsave using Plan A...
Hunk #1 succeeded at 1.
done
===> Applying OpenBSD patch patch-trafd_trafstart
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|$OpenBSD: patch-trafd_trafstart,v 1.1.1.1 2000/09/15 05:17:40 form Exp $
|--- trafd/trafstart.orig Wed Oct 27 16:47:01 1999
|+++ trafd/trafstart Fri Sep 15 11:23:19 2000
--------------------------
Patching file trafd/trafstart using Plan A...
Hunk #1 succeeded at 1.
done
===> Applying OpenBSD patch patch-trafd_trafstop
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|$OpenBSD: patch-trafd_trafstop,v 1.1.1.1 2000/09/15 05:17:40 form Exp $
|--- trafd/trafstop.orig Sat Nov 6 17:39:56 1993
|+++ trafd/trafstop Fri Sep 15 11:23:19 2000
--------------------------
Patching file trafd/trafstop using Plan A...
Hunk #1 succeeded at 1.
done
===> Configuring for trafd-3.0.1
===> Building for trafd-3.0.1
===> Build in lib <===
clang -O2 -pipe -I../include -DRETSIGTYPE=void -DRETSIGVAL=
-DPATH_TOSAVE=\"/var/trafd/\" -DPATH_TRAFSTAT=\"/usr/local/bin/trafstat\"
-DPATH_TRAFSTAT_LOG=\"/var/log/trafstat.log\"
-DPATH_TRAFLOG_FMT=\"/etc/traflog.format\" -c addrtoname.c
In file included from addrtoname.c:58:
../include/interface.h:138:20: warning: unknown attribute 'volatile' ignored
[-Wunknown-attributes]
__attribute__((volatile, format (printf, 1, 2)));
^
1 warning generated.
clang -O2 -pipe -I../include -DRETSIGTYPE=void -DRETSIGVAL=
-DPATH_TOSAVE=\"/var/trafd/\" -DPATH_TRAFSTAT=\"/usr/local/bin/trafstat\"
-DPATH_TRAFSTAT_LOG=\"/var/log/trafstat.log\"
-DPATH_TRAFLOG_FMT=\"/etc/traflog.format\" -c bpf_dump.c
In file included from bpf_dump.c:32:
../include/interface.h:138:20: warning: unknown attribute 'volatile' ignored
[-Wunknown-attributes]
__attribute__((volatile, format (printf, 1, 2)));
^
1 warning generated.
clang -O2 -pipe -I../include -DRETSIGTYPE=void -DRETSIGVAL=
-DPATH_TOSAVE=\"/var/trafd/\" -DPATH_TRAFSTAT=\"/usr/local/bin/trafstat\"
-DPATH_TRAFSTAT_LOG=\"/var/log/trafstat.log\"
-DPATH_TRAFLOG_FMT=\"/etc/traflog.format\" -c interfaces.c
In file included from interfaces.c:48:
../include/interface.h:138:20: warning: unknown attribute 'volatile' ignored
[-Wunknown-attributes]
__attribute__((volatile, format (printf, 1, 2)));
^
interfaces.c:125:2: warning: implicitly declaring library function 'memcpy'
with type 'void *(void *, const void *, unsigned long)'
[-Wimplicit-function-declaration]
memcpy((char *)&family, (char *)p, sizeof(family));
^
interfaces.c:125:2: note: include the header <string.h> or explicitly provide a
declaration for 'memcpy'
2 warnings generated.
clang -O2 -pipe -I../include -DRETSIGTYPE=void -DRETSIGVAL=
-DPATH_TOSAVE=\"/var/trafd/\" -DPATH_TRAFSTAT=\"/usr/local/bin/trafstat\"
-DPATH_TRAFSTAT_LOG=\"/var/log/trafstat.log\"
-DPATH_TRAFLOG_FMT=\"/etc/traflog.format\" -c util.c
In file included from util.c:50:
../include/interface.h:138:20: warning: unknown attribute 'volatile' ignored
[-Wunknown-attributes]
__attribute__((volatile, format (printf, 1, 2)));
^
1 warning generated.
clang -O2 -pipe -I../include -DRETSIGTYPE=void -DRETSIGVAL=
-DPATH_TOSAVE=\"/var/trafd/\" -DPATH_TRAFSTAT=\"/usr/local/bin/trafstat\"
-DPATH_TRAFSTAT_LOG=\"/var/log/trafstat.log\"
-DPATH_TRAFLOG_FMT=\"/etc/traflog.format\" -c savestr.c
savestr.c:46:9: warning: implicitly declaring library function 'strlen' with
type 'unsigned long (const char *)' [-Wimplicit-function-declaration]
size = strlen(str) + 1;
^
savestr.c:46:9: note: include the header <string.h> or explicitly provide a
declaration for 'strlen'
savestr.c:57:8: warning: implicitly declaring library function 'strcpy' with
type 'char *(char *, const char *)' [-Wimplicit-function-declaration]
(void)strcpy(strptr, str);
^
savestr.c:57:8: note: include the header <string.h> or explicitly provide a
declaration for 'strcpy'
2 warnings generated.
clang -O2 -pipe -I../include -DRETSIGTYPE=void -DRETSIGVAL=
-DPATH_TOSAVE=\"/var/trafd/\" -DPATH_TRAFSTAT=\"/usr/local/bin/trafstat\"
-DPATH_TRAFSTAT_LOG=\"/var/log/trafstat.log\"
-DPATH_TRAFLOG_FMT=\"/etc/traflog.format\" -c setsignal.c
clang -O2 -pipe -I../include -DRETSIGTYPE=void -DRETSIGVAL=
-DPATH_TOSAVE=\"/var/trafd/\" -DPATH_TRAFSTAT=\"/usr/local/bin/trafstat\"
-DPATH_TRAFSTAT_LOG=\"/var/log/trafstat.log\"
-DPATH_TRAFLOG_FMT=\"/etc/traflog.format\" -c version.c
rm -f libbpft.a
ar rc libbpft.a addrtoname.o bpf_dump.o interfaces.o util.o savestr.o
setsignal.o version.o
ranlib libbpft.a
===> Build in trafd <===
clang -O2 -pipe -I../include -DRETSIGTYPE=void -DRETSIGVAL=
-DPATH_TOSAVE=\"/var/trafd/\" -DPATH_TRAFSTAT=\"/usr/local/bin/trafstat\"
-DPATH_TRAFSTAT_LOG=\"/var/log/trafstat.log\"
-DPATH_TRAFLOG_FMT=\"/etc/traflog.format\" -c main.c
In file included from main.c:46:
./../include/interface.h:138:20: warning: unknown attribute 'volatile' ignored
[-Wunknown-attributes]
__attribute__((volatile, format (printf, 1, 2)));
^
main.c:89:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
void
^
main.c:89:1: note: change return type to 'int'
void
^~~~
int
main.c:192:2: warning: implicit declaration of function 'init_addrtoname' is
invalid in C99 [-Wimplicit-function-declaration]
init_addrtoname(localnet, netmask);
^
main.c:310:6: warning: implicit declaration of function 'wait' is invalid in
C99 [-Wimplicit-function-declaration]
if (wait(0) == -1)
^
4 warnings generated.
clang -O2 -pipe -I../include -DRETSIGTYPE=void -DRETSIGVAL=
-DPATH_TOSAVE=\"/var/trafd/\" -DPATH_TRAFSTAT=\"/usr/local/bin/trafstat\"
-DPATH_TRAFSTAT_LOG=\"/var/log/trafstat.log\"
-DPATH_TRAFLOG_FMT=\"/etc/traflog.format\" -c traffic.c
In file included from traffic.c:61:
../include/interface.h:138:20: warning: unknown attribute 'volatile' ignored
[-Wunknown-attributes]
__attribute__((volatile, format (printf, 1, 2)));
^
traffic.c:93:12: warning: using the result of an assignment as a condition
without parentheses [-Wparentheses]
while (sv = getservent()) {
~~~^~~~~~~~~~~~~~
traffic.c:93:12: note: place parentheses around the assignment to silence this
warning
while (sv = getservent()) {
^
( )
traffic.c:93:12: note: use '==' to turn this assignment into an equality
comparison
while (sv = getservent()) {
^
==
traffic.c:533:34: warning: passing 'const struct ip *' to parameter of type
'struct ip *' discards qualifiers
[-Wincompatible-pointer-types-discards-qualifiers]
traf_tcp((struct tcphdr *)cp, ip);
^~
traffic.c:536:34: warning: passing 'const struct ip *' to parameter of type
'struct ip *' discards qualifiers
[-Wincompatible-pointer-types-discards-qualifiers]
traf_udp((struct udphdr *)cp, ip);
^~
traffic.c:539:12: warning: passing 'const struct ip *' to parameter of type
'struct ip *' discards qualifiers
[-Wincompatible-pointer-types-discards-qualifiers]
traf_ip(ip);
^~
traffic.c:542:17: warning: passing 'const struct ip *' to parameter of type
'struct ip *' discards qualifiers
[-Wincompatible-pointer-types-discards-qualifiers]
} else traf_ip(ip);
^~
6 warnings generated.
clang main.o traffic.o ../lib/libbpft.a -o trafd -lpcap -ll
main.o: In function `main':
main.c:(.text+0x153): warning: warning: sprintf() is often misused, please use
snprintf()
traffic.o: In function `traf_pipe':
traffic.c:(.text+0xe93): warning: warning: strcpy() is almost always misused,
please use strlcpy()
===> Build in trafstat <===
clang -O2 -pipe -I../include -DRETSIGTYPE=void -DRETSIGVAL=
-DPATH_TOSAVE=\"/var/trafd/\" -DPATH_TRAFSTAT=\"/usr/local/bin/trafstat\"
-DPATH_TRAFSTAT_LOG=\"/var/log/trafstat.log\"
-DPATH_TRAFLOG_FMT=\"/etc/traflog.format\" -c main.c
In file included from main.c:47:
../include/interface.h:138:20: warning: unknown attribute 'volatile' ignored
[-Wunknown-attributes]
__attribute__((volatile, format (printf, 1, 2)));
^
main.c:75:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
void
^
main.c:75:1: note: change return type to 'int'
void
^~~~
int
main.c:151:4: warning: implicit declaration of function 'bcopy' is invalid in
C99 [-Wimplicit-function-declaration]
bcopy(hp->h_addr, (char *)&server.sin_addr,
^
main.c:170:19: warning: implicitly declaring library function 'strlen' with
type 'unsigned long (const char *)' [-Wimplicit-function-declaration]
write(ifd, buf, strlen(buf));
^
main.c:170:19: note: include the header <string.h> or explicitly provide a
declaration for 'strlen'
main.c:205:3: warning: implicitly declaring library function 'strcpy' with type
'char *(char *, const char *)' [-Wimplicit-function-declaration]
strcpy(un.sun_path, file_fifo);
^
main.c:205:3: note: include the header <string.h> or explicitly provide a
declaration for 'strcpy'
5 warnings generated.
clang -O2 -pipe -I../include -DRETSIGTYPE=void -DRETSIGVAL=
-DPATH_TOSAVE=\"/var/trafd/\" -DPATH_TRAFSTAT=\"/usr/local/bin/trafstat\"
-DPATH_TRAFSTAT_LOG=\"/var/log/trafstat.log\"
-DPATH_TRAFLOG_FMT=\"/etc/traflog.format\" -c trafstat.c
trafstat.c:62:3: warning: implicit declaration of function 'warning' is invalid
in C99 [-Wimplicit-function-declaration]
warning("confusion, is't trafstat port or error");
^
trafstat.c:66:35: warning: implicitly declaring library function 'malloc' with
type 'void *(unsigned long)' [-Wimplicit-function-declaration]
if ((entries = (struct t_entry *)malloc(size)) == NULL) {
^
trafstat.c:66:35: note: include the header <stdlib.h> or explicitly provide a
declaration for 'malloc'
trafstat.c:120:2: warning: implicit declaration of function 'qsort' is invalid
in C99 [-Wimplicit-function-declaration]
qsort(entries, n_entry, sizeof(struct t_entry), sortbysize);
^
3 warnings generated.
clang main.o trafstat.o -L../lib -lbpft -lpcap -o trafstat
main.o: In function `main':
main.c:(.text+0x1e0): warning: warning: sprintf() is often misused, please use
snprintf()
main.c:(.text+0x498): warning: warning: strcpy() is almost always misused,
please use strlcpy()
===> Build in trafstatd <===
clang -O2 -pipe -I../include -DRETSIGTYPE=void -DRETSIGVAL=
-DPATH_TOSAVE=\"/var/trafd/\" -DPATH_TRAFSTAT=\"/usr/local/bin/trafstat\"
-DPATH_TRAFSTAT_LOG=\"/var/log/trafstat.log\"
-DPATH_TRAFLOG_FMT=\"/etc/traflog.format\" -c trafstatd.c
trafstatd.c:42:1: warning: return type of 'main' is not 'int'
[-Wmain-return-type]
void
^
trafstatd.c:42:1: note: change return type to 'int'
void
^~~~
int
1 warning generated.
clang trafstatd.o -L../lib -lbpft -o trafstatd
===> Build in traflog <===
clang -O2 -pipe -I../include -DRETSIGTYPE=void -DRETSIGVAL=
-DPATH_TOSAVE=\"/var/trafd/\" -DPATH_TRAFSTAT=\"/usr/local/bin/trafstat\"
-DPATH_TRAFSTAT_LOG=\"/var/log/trafstat.log\"
-DPATH_TRAFLOG_FMT=\"/etc/traflog.format\" -c main.c
In file included from main.c:46:
./../include/interface.h:138:20: warning: unknown attribute 'volatile' ignored
[-Wunknown-attributes]
__attribute__((volatile, format (printf, 1, 2)));
^
main.c:103:5: warning: implicit declaration of function 'setthetime' is invalid
in C99 [-Wimplicit-function-declaration]
setthetime(optarg, &tb);
^
main.c:139:9: warning: implicit declaration of function 'get_format' is invalid
in C99 [-Wimplicit-function-declaration]
if (!get_format(optarg))
^
main.c:170:2: warning: implicit declaration of function 'pattern' is invalid in
C99 [-Wimplicit-function-declaration]
pattern(cmdbuf);
^
main.c:172:8: warning: implicit declaration of function 'pat_print' is invalid
in C99 [-Wimplicit-function-declaration]
exit(pat_print());
^
main.c:195:2: warning: implicit declaration of function 'log_loop' is invalid
in C99 [-Wimplicit-function-declaration]
log_loop(fd, fdw);
^
main.c:240:10: warning: implicit declaration of function 'iskey' is invalid in
C99 [-Wimplicit-function-declaration]
ptr += iskey(ptr);
^
main.c:252:11: warning: implicit declaration of function 'isformat' is invalid
in C99 [-Wimplicit-function-declaration]
if (i = isformat(token + 4))
^
main.c:252:9: warning: using the result of an assignment as a condition without
parentheses [-Wparentheses]
if (i = isformat(token + 4))
~~^~~~~~~~~~~~~~~~~~~~~
main.c:252:9: note: place parentheses around the assignment to silence this
warning
if (i = isformat(token + 4))
^
( )
main.c:252:9: note: use '==' to turn this assignment into an equality comparison
if (i = isformat(token + 4))
^
==
main.c:257:9: warning: using the result of an assignment as a condition without
parentheses [-Wparentheses]
if (i = isformat(token + 2))
~~^~~~~~~~~~~~~~~~~~~~~
main.c:257:9: note: place parentheses around the assignment to silence this
warning
if (i = isformat(token + 2))
^
( )
main.c:257:9: note: use '==' to turn this assignment into an equality comparison
if (i = isformat(token + 2))
^
==
main.c:262:9: warning: using the result of an assignment as a condition without
parentheses [-Wparentheses]
if (i = isformat(token + 5))
~~^~~~~~~~~~~~~~~~~~~~~
main.c:262:9: note: place parentheses around the assignment to silence this
warning
if (i = isformat(token + 5))
^
( )
main.c:262:9: note: use '==' to turn this assignment into an equality comparison
if (i = isformat(token + 5))
^
==
main.c:267:9: warning: using the result of an assignment as a condition without
parentheses [-Wparentheses]
if (i = isformat(token + 5))
~~^~~~~~~~~~~~~~~~~~~~~
main.c:267:9: note: place parentheses around the assignment to silence this
warning
if (i = isformat(token + 5))
^
( )
main.c:267:9: note: use '==' to turn this assignment into an equality comparison
if (i = isformat(token + 5))
^
==
main.c:272:9: warning: using the result of an assignment as a condition without
parentheses [-Wparentheses]
if (i = isformat(token + 5))
~~^~~~~~~~~~~~~~~~~~~~~
main.c:272:9: note: place parentheses around the assignment to silence this
warning
if (i = isformat(token + 5))
^
( )
main.c:272:9: note: use '==' to turn this assignment into an equality comparison
if (i = isformat(token + 5))
^
==
main.c:277:9: warning: using the result of an assignment as a condition without
parentheses [-Wparentheses]
if (i = isformat(token + 5))
~~^~~~~~~~~~~~~~~~~~~~~
main.c:277:9: note: place parentheses around the assignment to silence this
warning
if (i = isformat(token + 5))
^
( )
main.c:277:9: note: use '==' to turn this assignment into an equality comparison
if (i = isformat(token + 5))
^
==
main.c:282:9: warning: using the result of an assignment as a condition without
parentheses [-Wparentheses]
if (i = isformat(token + 5))
~~^~~~~~~~~~~~~~~~~~~~~
main.c:282:9: note: place parentheses around the assignment to silence this
warning
if (i = isformat(token + 5))
^
( )
main.c:282:9: note: use '==' to turn this assignment into an equality comparison
if (i = isformat(token + 5))
^
==
main.c:287:9: warning: using the result of an assignment as a condition without
parentheses [-Wparentheses]
if (i = isformat(token + 5))
~~^~~~~~~~~~~~~~~~~~~~~
main.c:287:9: note: place parentheses around the assignment to silence this
warning
if (i = isformat(token + 5))
^
( )
main.c:287:9: note: use '==' to turn this assignment into an equality comparison
if (i = isformat(token + 5))
^
==
main.c:292:9: warning: using the result of an assignment as a condition without
parentheses [-Wparentheses]
if (i = isformat(token + 5))
~~^~~~~~~~~~~~~~~~~~~~~
main.c:292:9: note: place parentheses around the assignment to silence this
warning
if (i = isformat(token + 5))
^
( )
main.c:292:9: note: use '==' to turn this assignment into an equality comparison
if (i = isformat(token + 5))
^
==
main.c:353:8: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
static days_in_month[12] =
~~~~~~ ^
main.c:357:1: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
setthetime(p, tv)
^
main.c:367:4: warning: implicit declaration of function 'badformat' is invalid
in C99 [-Wimplicit-function-declaration]
badformat();
^
main.c:371:8: warning: using the result of an assignment as a condition without
parentheses [-Wparentheses]
if (t = index(p, '.')) { /* .ss */
~~^~~~~~~~~~~~~~~
main.c:371:8: note: place parentheses around the assignment to silence this
warning
if (t = index(p, '.')) { /* .ss */
^
( )
main.c:371:8: note: use '==' to turn this assignment into an equality comparison
if (t = index(p, '.')) { /* .ss */
^
==
main.c:423:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
main.c:425:1: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
badformat()
^
23 warnings generated.
clang -O2 -pipe -I../include -DRETSIGTYPE=void -DRETSIGVAL=
-DPATH_TOSAVE=\"/var/trafd/\" -DPATH_TRAFSTAT=\"/usr/local/bin/trafstat\"
-DPATH_TRAFSTAT_LOG=\"/var/log/trafstat.log\"
-DPATH_TRAFLOG_FMT=\"/etc/traflog.format\" -c traflog.c
In file included from traflog.c:52:
../include/interface.h:138:20: warning: unknown attribute 'volatile' ignored
[-Wunknown-attributes]
__attribute__((volatile, format (printf, 1, 2)));
^
traflog.c:117:10: warning: using the result of an assignment as a condition
without parentheses [-Wparentheses]
if (np = getnetbyaddr(net, AF_INET))
~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
traflog.c:117:10: note: place parentheses around the assignment to silence this
warning
if (np = getnetbyaddr(net, AF_INET))
^
( )
traflog.c:117:10: note: use '==' to turn this assignment into an equality
comparison
if (np = getnetbyaddr(net, AF_INET))
^
==
traflog.c:124:23: warning: format specifies type 'unsigned int' but the
argument has type 'unsigned long' [-Wformat]
sprintf(line, "%u", C(i >> 24));
~~ ^~~~~~~~~~
%lu
traflog.c:120:14: note: expanded from macro 'C'
#define C(x) ((x) & 0xff)
^~~~~~~~~~~~
traflog.c:126:26: warning: format specifies type 'unsigned int' but the
argument has type 'unsigned long' [-Wformat]
sprintf(line, "%u.%u", C(i >> 24) , C(i >> 16));
~~ ^~~~~~~~~~
%lu
traflog.c:120:14: note: expanded from macro 'C'
#define C(x) ((x) & 0xff)
^~~~~~~~~~~~
traflog.c:126:39: warning: format specifies type 'unsigned int' but the
argument has type 'unsigned long' [-Wformat]
sprintf(line, "%u.%u", C(i >> 24) , C(i >> 16));
~~ ^~~~~~~~~~
%lu
traflog.c:120:14: note: expanded from macro 'C'
#define C(x) ((x) & 0xff)
^~~~~~~~~~~~
traflog.c:128:29: warning: format specifies type 'unsigned int' but the
argument has type 'unsigned long' [-Wformat]
sprintf(line, "%u.%u.%u", C(i >> 24), C(i >> 16), C(i >> 8));
~~ ^~~~~~~~~~
%lu
traflog.c:120:14: note: expanded from macro 'C'
#define C(x) ((x) & 0xff)
^~~~~~~~~~~~
traflog.c:128:41: warning: format specifies type 'unsigned int' but the
argument has type 'unsigned long' [-Wformat]
sprintf(line, "%u.%u.%u", C(i >> 24), C(i >> 16), C(i >> 8));
~~ ^~~~~~~~~~
%lu
traflog.c:120:14: note: expanded from macro 'C'
#define C(x) ((x) & 0xff)
^~~~~~~~~~~~
traflog.c:128:53: warning: format specifies type 'unsigned int' but the
argument has type 'unsigned long' [-Wformat]
sprintf(line, "%u.%u.%u", C(i >> 24), C(i >> 16), C(i >> 8));
~~ ^~~~~~~~~
%lu
traflog.c:120:14: note: expanded from macro 'C'
#define C(x) ((x) & 0xff)
^~~~~~~~~~~~
traflog.c:130:32: warning: format specifies type 'unsigned int' but the
argument has type 'unsigned long' [-Wformat]
sprintf(line, "%u.%u.%u.%u", C(i >> 24),
~~ ^~~~~~~~~~
%lu
traflog.c:120:14: note: expanded from macro 'C'
#define C(x) ((x) & 0xff)
^~~~~~~~~~~~
traflog.c:131:4: warning: format specifies type 'unsigned int' but the argument
has type 'unsigned long' [-Wformat]
C(i >> 16), C(i >> 8), C(i));
^~~~~~~~~~
traflog.c:120:14: note: expanded from macro 'C'
#define C(x) ((x) & 0xff)
^~~~~~~~~~~~
traflog.c:131:16: warning: format specifies type 'unsigned int' but the
argument has type 'unsigned long' [-Wformat]
C(i >> 16), C(i >> 8), C(i));
^~~~~~~~~
traflog.c:120:14: note: expanded from macro 'C'
#define C(x) ((x) & 0xff)
^~~~~~~~~~~~
traflog.c:131:27: warning: format specifies type 'unsigned int' but the
argument has type 'unsigned long' [-Wformat]
C(i >> 16), C(i >> 8), C(i));
^~~~
traflog.c:120:14: note: expanded from macro 'C'
#define C(x) ((x) & 0xff)
^~~~~~~~~~~~
traflog.c:150:13: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
register p = htons(pat[i].p_port);
~~~~~~~~ ^
traflog.c:152:13: warning: using the result of an assignment as a condition
without parentheses [-Wparentheses]
if (svc = getservbyport(p, "tcp")) {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
traflog.c:152:13: note: place parentheses around the assignment to silence this
warning
if (svc = getservbyport(p, "tcp")) {
^
( )
traflog.c:152:13: note: use '==' to turn this assignment into an equality
comparison
if (svc = getservbyport(p, "tcp")) {
^
==
traflog.c:157:13: warning: using the result of an assignment as a condition
without parentheses [-Wparentheses]
if (svc = getservbyport(p, "udp")) {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
traflog.c:157:13: note: place parentheses around the assignment to silence this
warning
if (svc = getservbyport(p, "udp")) {
^
( )
traflog.c:157:13: note: use '==' to turn this assignment into an equality
comparison
if (svc = getservbyport(p, "udp")) {
^
==
traflog.c:188:3: warning: implicit declaration of function 'net_mask' is
invalid in C99 [-Wimplicit-function-declaration]
net_mask(&in.s_addr);
^
traflog.c:197:9: warning: using the result of an assignment as a condition
without parentheses [-Wparentheses]
if (np = getnetbyname(cmdarg)) {
~~~^~~~~~~~~~~~~~~~~~~~~~
traflog.c:197:9: note: place parentheses around the assignment to silence this
warning
if (np = getnetbyname(cmdarg)) {
^
( )
traflog.c:197:9: note: use '==' to turn this assignment into an equality
comparison
if (np = getnetbyname(cmdarg)) {
^
==
traflog.c:202:9: warning: using the result of an assignment as a condition
without parentheses [-Wparentheses]
if (hp = gethostbyname(cmdarg)) {
~~~^~~~~~~~~~~~~~~~~~~~~~~
traflog.c:202:9: note: place parentheses around the assignment to silence this
warning
if (hp = gethostbyname(cmdarg)) {
^
( )
traflog.c:202:9: note: use '==' to turn this assignment into an equality
comparison
if (hp = gethostbyname(cmdarg)) {
^
==
traflog.c:248:15: warning: using the result of an assignment as a condition
without parentheses [-Wparentheses]
while (token = strtok(cmdbuf, " \t\r\n")) {
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
traflog.c:248:15: note: place parentheses around the assignment to silence this
warning
while (token = strtok(cmdbuf, " \t\r\n")) {
^
( )
traflog.c:248:15: note: use '==' to turn this assignment into an equality
comparison
while (token = strtok(cmdbuf, " \t\r\n")) {
^
==
traflog.c:260:7: warning: incompatible pointer types passing 'in_addr_t *' (aka
'unsigned int *') to parameter of type 'u_long *' (aka 'unsigned long *')
[-Wincompatible-pointer-types]
&pat[n_pat-1].in_mask.s_addr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
traflog.c:264:7: warning: incompatible pointer types passing 'in_addr_t *' (aka
'unsigned int *') to parameter of type 'u_long *' (aka 'unsigned long *')
[-Wincompatible-pointer-types]
&pat[n_pat-1].out_mask.s_addr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
traflog.c:285:13: warning: using the result of an assignment as a condition
without parentheses [-Wparentheses]
if (svc = getservbyname(cmdarg, "tcp"))
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
traflog.c:285:13: note: place parentheses around the assignment to silence this
warning
if (svc = getservbyname(cmdarg, "tcp"))
^
( )
traflog.c:285:13: note: use '==' to turn this assignment into an equality
comparison
if (svc = getservbyname(cmdarg, "tcp"))
^
==
traflog.c:287:13: warning: using the result of an assignment as a condition
without parentheses [-Wparentheses]
if (svc = getservbyname(cmdarg, "udp"))
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
traflog.c:287:13: note: place parentheses around the assignment to silence this
warning
if (svc = getservbyname(cmdarg, "udp"))
^
( )
traflog.c:287:13: note: use '==' to turn this assignment into an equality
comparison
if (svc = getservbyname(cmdarg, "udp"))
^
==
traflog.c:311:2: error: non-void function 'pattern' should return a value
[-Wreturn-type]
return;
^
traflog.c:441:1: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
log_loop(fd, fdw)
^
traflog.c:450:7: warning: implicit declaration of function 'range' is invalid
in C99 [-Wimplicit-function-declaration]
if (range(&h) == 2) {
^
traflog.c:456:14: warning: implicit declaration of function 'traf_write' is
invalid in C99 [-Wimplicit-function-declaration]
if (fdw) traf_write(fdw);
^
traflog.c:457:10: warning: implicit declaration of function 'traf_print' is
invalid in C99 [-Wimplicit-function-declaration]
else traf_print();
^
traflog.c:463:3: error: non-void function 'log_loop' should return a value
[-Wreturn-type]
return;
^
traflog.c:467:3: error: non-void function 'log_loop' should return a value
[-Wreturn-type]
return;
^
traflog.c:472:2: error: non-void function 'log_loop' should return a value
[-Wreturn-type]
return;
^
traflog.c:475:1: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
range(h)
^
traflog.c:478:11: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
register true = 0;
~~~~~~~~ ^
traflog.c:497:1: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
traf_write(fd)
^
traflog.c:504:2: error: non-void function 'traf_write' should return a value
[-Wreturn-type]
return;
^
traflog.c:557:1: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
traf_print()
^
traflog.c:567:3: error: non-void function 'traf_print' should return a value
[-Wreturn-type]
return;
^
31 warnings and 6 errors generated.
*** Error 1 in traflog (<sys.mk>:87 'traflog.o')
*** Error 1 in /usr/ports/pobj/trafd-3.0.1/trafd-3.0.1 (Makefile:63 'all')
*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2644
'/usr/ports/pobj/trafd-3.0.1/.build_done')
*** Error 1 in /usr/ports/net/trafd
(/usr/ports/infrastructure/mk/bsd.port.mk:2345 'all')
The amount of scary errors in that build lead me to think that trafd
should be sent to the Attic. This is a pcap listener that runs as root,
with no privsep/privdrop/chroot at all. The documentation is lacking.
There seems to be a "recently" active upstream at
http://trafd.sourceforge.net/ but only two beta releases seem to have
been published there.
ok to remove it?
--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE