]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/ipv4/netfilter/ipt_ULOG.c
[NETFILTER]: Remove changelogs and CVS IDs
[karo-tx-linux.git] / net / ipv4 / netfilter / ipt_ULOG.c
index 3a1eacc634b357d7de5c870bf805052eb74f6ec0..57f51af357279197eebfc815502f730cbbe78bc2 100644 (file)
@@ -2,20 +2,6 @@
  * netfilter module for userspace packet logging daemons
  *
  * (C) 2000-2004 by Harald Welte <laforge@netfilter.org>
- *
- * 2000/09/22 ulog-cprange feature added
- * 2001/01/04 in-kernel queue as proposed by Sebastian Zander
- *                                             <zander@fokus.gmd.de>
- * 2001/01/30 per-rule nlgroup conflicts with global queue.
- *            nlgroup now global (sysctl)
- * 2001/04/19 ulog-queue reworked, now fixed buffer size specified at
- *           module loadtime -HW
- * 2002/07/07 remove broken nflog_rcv() function -HW
- * 2002/08/29 fix shifted/unshifted nlgroup bug -HW
- * 2002/10/30 fix uninitialized mac_len field - <Anders K. Pedersen>
- * 2004/10/25 fix erroneous calculation of 'len' parameter to NLMSG_PUT
- *           resulting in bogus 'error during NLMSG_PUT' messages.
- *
  * (C) 1999-2001 Paul `Rusty' Russell
  * (C) 2002-2004 Netfilter Core Team <coreteam@netfilter.org>
  *
@@ -42,8 +28,6 @@
  * flushtimeout:
  *   Specify, after how many hundredths of a second the queue should be
  *   flushed even if it is not full yet.
- *
- * ipt_ULOG.c,v 1.22 2002/10/30 09:07:31 laforge Exp
  */
 
 #include <linux/module.h>
@@ -61,6 +45,7 @@
 #include <linux/netfilter_ipv4/ipt_ULOG.h>
 #include <net/sock.h>
 #include <linux/bitops.h>
+#include <asm/unaligned.h>
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Harald Welte <laforge@gnumonks.org>");
@@ -186,6 +171,7 @@ static void ipt_ulog_packet(unsigned int hooknum,
        ulog_packet_msg_t *pm;
        size_t size, copy_len;
        struct nlmsghdr *nlh;
+       struct timeval tv;
 
        /* ffs == find first bit set, necessary because userspace
         * is already shifting groupnumber, but we need unshifted.
@@ -231,14 +217,15 @@ static void ipt_ulog_packet(unsigned int hooknum,
        pm = NLMSG_DATA(nlh);
 
        /* We might not have a timestamp, get one */
-       if (skb->tstamp.off_sec == 0)
+       if (skb->tstamp.tv64 == 0)
                __net_timestamp((struct sk_buff *)skb);
 
        /* copy hook, prefix, timestamp, payload, etc. */
        pm->data_len = copy_len;
-       pm->timestamp_sec = skb->tstamp.off_sec;
-       pm->timestamp_usec = skb->tstamp.off_usec;
-       pm->mark = skb->mark;
+       tv = ktime_to_timeval(skb->tstamp);
+       put_unaligned(tv.tv_sec, &pm->timestamp_sec);
+       put_unaligned(tv.tv_usec, &pm->timestamp_usec);
+       put_unaligned(skb->mark, &pm->mark);
        pm->hook = hooknum;
        if (prefix != NULL)
                strncpy(pm->prefix, prefix, sizeof(pm->prefix));
@@ -248,9 +235,9 @@ static void ipt_ulog_packet(unsigned int hooknum,
                *(pm->prefix) = '\0';
 
        if (in && in->hard_header_len > 0
-           && skb->mac.raw != (void *) skb->nh.iph
+           && skb->mac_header != skb->network_header
            && in->hard_header_len <= ULOG_MAC_LEN) {
-               memcpy(pm->mac, skb->mac.raw, in->hard_header_len);
+               memcpy(pm->mac, skb_mac_header(skb), in->hard_header_len);
                pm->mac_len = in->hard_header_len;
        } else
                pm->mac_len = 0;
@@ -419,7 +406,7 @@ static void __exit ipt_ulog_fini(void)
        DEBUGP("ipt_ULOG: cleanup_module\n");
 
        if (nflog)
-               nf_log_unregister_logger(&ipt_ulog_logger);
+               nf_log_unregister(&ipt_ulog_logger);
        xt_unregister_target(&ipt_ulog_reg);
        sock_release(nflognl->sk_socket);