Skip to content

Commit

Permalink
netfilter: use consistent ipv4 network offset in xt_AUDIT
Browse files Browse the repository at this point in the history
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 <[email protected]>
[PM: munged subject line]
Signed-off-by: Paul Moore <[email protected]>
  • Loading branch information
rgbriggs authored and pcmoore committed May 2, 2017
1 parent f6276ac commit 0cb88b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/xt_AUDIT.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0cb88b6

Please sign in to comment.