]> git.ipfire.org Git - thirdparty/ulogd2.git/commitdiff
real fix for skb receive timestamp problem (Harald Welte), revert PCAP workaround
authorlaforge <laforge>
Sun, 27 Apr 2003 07:43:37 +0000 (07:43 +0000)
committerlaforge <laforge>
Sun, 27 Apr 2003 07:43:37 +0000 (07:43 +0000)
extensions/ulogd_BASE.c
pcap/ulogd_PCAP.c

index 936843f95ee114173e2a5d0fc46b089931dd3ec8..e4460ac196ad0707f4ddbfe4a0e5ba6940c07263 100644 (file)
@@ -1,4 +1,4 @@
-/* ulogd_MAC.c, Version $Revision: 1.15 $
+/* ulogd_MAC.c, Version $Revision: 1.16 $
  *
  * ulogd interpreter plugin for 
  *     o MAC addresses
@@ -26,7 +26,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  
- * $Id: ulogd_BASE.c,v 1.15 2002/12/09 14:42:43 laforge Exp $
+ * $Id: ulogd_BASE.c,v 1.16 2003/01/13 13:35:58 laforge Exp $
  *
  */
 
@@ -111,10 +111,17 @@ static ulog_iret_t *_interp_oob(struct ulog_interpreter *ip,
 
        ret[0].value.ptr = pkt->prefix;
        ret[0].flags |= ULOGD_RETF_VALID;
-       ret[1].value.ui32 = pkt->timestamp_sec;
-       ret[1].flags |= ULOGD_RETF_VALID;
-       ret[2].value.ui32 = pkt->timestamp_usec;
-       ret[2].flags |= ULOGD_RETF_VALID;
+
+       if (pkt->timestamp_sec || pkt->timestamp_usec) {
+               ret[1].value.ui32 = pkt->timestamp_sec;
+               ret[1].flags |= ULOGD_RETF_VALID;
+               ret[2].value.ui32 = pkt->timestamp_usec;
+               ret[2].flags |= ULOGD_RETF_VALID;
+       } else {
+               ret[1].flags &= ~ULOGD_RETF_VALID;
+               ret[2].flags &= ~ULOGD_RETF_VALID;
+       }
+
        ret[3].value.ui32 = pkt->mark;
        ret[3].flags |= ULOGD_RETF_VALID;
        ret[4].value.ptr = pkt->indev_name;
index 178d294dfb59b0fe11e1d3e60925929a5452f868..9c554ccca5c60f44fd1b8cc1877bd1b772b196fb 100644 (file)
@@ -1,4 +1,4 @@
-/* ulogd_PCAP.c, Version $Revision: 1.2 $
+/* ulogd_PCAP.c, Version $Revision: 1.3 $
  *
  * ulogd output target for writing pcap-style files (like tcpdump)
  *
@@ -20,7 +20,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- * $Id: ulogd_PCAP.c,v 1.2 2002/12/09 14:42:44 laforge Exp $
+ * $Id: ulogd_PCAP.c,v 1.3 2003/04/27 07:39:07 laforge Exp $
  *
  */
 
@@ -88,8 +88,7 @@ int _output_pcap(ulog_iret_t *res)
        pchdr.len = GET_VALUE(2).ui32;
 
        if (GET_FLAGS(3) & ULOGD_RETF_VALID
-           && GET_FLAGS(4) & ULOGD_RETF_VALID
-           && GET_VALUE(3).ui32 != 0) {
+           && GET_FLAGS(4) & ULOGD_RETF_VALID) {
                pchdr.ts.tv_sec = GET_VALUE(3).ui32;
                pchdr.ts.tv_usec = GET_VALUE(4).ui32;
        } else {