OpenBSD 3.1

Andreas Östling andreaso at it.su.se
Wed May 22 03:30:11 EDT 2002


> gcc -O2 -I.  -I../include -DHAVE_TCP_WRAPPER=1 -DHAVE_SYS_SOCKIO_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 -DHAVE_SYS_FILE_H=1 -DHAVE_SYSLOG_H=1 -DHAVE_ETHER_HOSTTON=1 -DHAVE_STRERROR=1 -c ./ArgusSource.c
> ./ArgusSource.c: In function `ArgusSnoopRead':
> ./ArgusSource.c:407: incompatible types in assignment
> *** Error code 1

Would it be a bad idea to assign tv_sec and tv_usec respectively, instead
of the entire [bpf_]timeval struct at once? It compiles/runs on 3.1 here.


--- ArgusSource.c.orig  Wed May 22 08:49:38 2002
+++ ArgusSource.c       Wed May 22 08:49:42 2002
@@ -404,9 +404,10 @@

       if ((len = ((SnoopPktHdr.tlen + 3) & 0xFFFFFFC)) < 1500) {
          if ((retn = read(pcap_fileno(ArgusPd[0]), ArgusPacketBuf, len)) == len) {
-            pcap_pkthdr.ts     = SnoopPktHdr.argtvp;
-            pcap_pkthdr.caplen = SnoopPktHdr.tlen;
-            pcap_pkthdr.len    = SnoopPktHdr.len;
+            pcap_pkthdr.ts.tv_sec  = SnoopPktHdr.argtvp.tv_sec;
+            pcap_pkthdr.ts.tv_usec = SnoopPktHdr.argtvp.tv_usec;
+            pcap_pkthdr.caplen     = SnoopPktHdr.tlen;
+            pcap_pkthdr.len        = SnoopPktHdr.len;

             if ((ArgusFilters[0].bf_insns == NULL) ||
                (bpf_filter(ArgusFilters[0].bf_insns, ArgusPacketBuf, SnoopPktHdr.tlen, ArgusSnapLen))) {


/Andreas



More information about the argus mailing list