]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
netfilter: use consistent ipv4 network offset in xt_AUDIT
authorRichard Guy Briggs <rgb@redhat.com>
Tue, 2 May 2017 14:16:04 +0000 (10:16 -0400)
committerPaul Moore <paul@paul-moore.com>
Tue, 2 May 2017 14:16:04 +0000 (10:16 -0400)
Even though the skb->data pointer has been moved from the link layer
header to the network layer header, use the same method to calculate the
offset in ipv4 and ipv6 routines.

Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
[PM: munged subject line]
Signed-off-by: Paul Moore <paul@paul-moore.com>
net/netfilter/xt_AUDIT.c

index 19247a17e5114f1e278e30508085463d7396959e..5181f69ec9bf1da865d63d9d94341ee6c342f5fa 100644 (file)
@@ -76,7 +76,7 @@ static void audit_ip4(struct audit_buffer *ab, struct sk_buff *skb)
        struct iphdr _iph;
        const struct iphdr *ih;
 
-       ih = skb_header_pointer(skb, 0, sizeof(_iph), &_iph);
+       ih = skb_header_pointer(skb, skb_network_offset(skb), sizeof(_iph), &_iph);
        if (!ih) {
                audit_log_format(ab, " truncated=1");
                return;