netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* icmp_hdr is wrong on CentOS 6 kernels (2.6.32-754.12.1)
@ 2019-09-18  2:53 Olivia Nelson
  0 siblings, 0 replies; only message in thread
From: Olivia Nelson @ 2019-09-18  2:53 UTC (permalink / raw)
  To: netfilter-devel

I have a simple netfilter module to test icmp_hdr function:

unsigned int hook_func(
    unsigned int hooknum,
    struct sk_buff *skb,
    const struct net_device *in,
    const struct net_device *out,
    int (*okfn)(struct sk_buff *))
{
    const struct iphdr *ip_header = ip_hdr(skb);
    if (ip_header && ip_header->protocol == IPPROTO_ICMP)
    {
        const struct icmphdr *icmp_header = icmp_hdr(skb);
        printk(KERN_INFO "ICMP type %d", icmp_header->type);
    }

    return NF_ACCEPT;
}

Then I start to PING the HOST.

On CentOS 6 (2.6.32-754.12.1.el6.x86_64), he printed ICMP type is
always 69 (INVALID).
On CentOS 7 (3.10) the result is ICMP_ECHO (8), which is correct.

Was it a bug?

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-18  2:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-18  2:53 icmp_hdr is wrong on CentOS 6 kernels (2.6.32-754.12.1) Olivia Nelson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).