Netfilter interface change in kernel 4.4.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I am trying to update kernel module that used to run for kernel version < 4.4.0.
I found out that struct nf_hook_ops and the signature for function type nf_hookfn have changed for kernels higher than version 4.4.0. 
However, I couldn't find any documentation that explains the change. 

To be precise for kernel 4.1.0 (http://lxr.free-electrons.com/source/include/linux/netfilter.h?v=4.1), 

77 typedef unsigned int nf_hookfn(const struct nf_hook_ops *ops,
78                                struct sk_buff *skb,
79                                const struct nf_hook_state *state);
80 
81 struct nf_hook_ops {
82         struct list_head list;
83 
84         /* User fills in from here down. */
85         nf_hookfn       *hook;
86         struct module   *owner;
87         void            *priv;
88         u_int8_t        pf;
89         unsigned int    hooknum;
90         /* Hooks are ordered in ascending priority. */
91         int             priority;
92 };


for kernel 4.4.0 (http://lxr.free-electrons.com/source/include/linux/netfilter.h?v=4.4), 

 83 typedef unsigned int nf_hookfn(void *priv,
 84                                struct sk_buff *skb,
 85                                const struct nf_hook_state *state);
 86 
 87 struct nf_hook_ops {
 88         struct list_head        list;
 89 
 90         /* User fills in from here down. */
 91         nf_hookfn               *hook;
 92         struct net_device       *dev;
 93         void                    *priv;
 94         u_int8_t                pf;
 95         unsigned int            hooknum;
 96         /* Hooks are ordered in ascending priority. */
 97         int                     priority;
 98 };

As you can see, the first parameter of nf_hookfn() is changed 
    from 
      const struct nf_hook_ops *ops 
    to 
      void *priv 

and struct nf_hook_ops no longer has the member for 

struct module   *owner;

and instead has the member of

struct net_device       *dev;


If anyone can tell me how to cope with this changes, it will be very helpful. 

Thanks!

Regards, Kangkook

--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux