I'm implementing a "mini firewall".
I've implemented the filter function and this is the signture;
unsigned int minifw_inbound_filter(unsigned int hooknum, struct sk_buff *skb, const struct net_device *in,
const struct net_device *out, int (*okfn)(struct sk_buff *));
When I added the netfilter kernel module:
static struct nf_hook_ops nfho_in;
nt init_rule_match_module(void) {
nfho_in.hook = minifw_inbound_filter; // filter for inbound packets
nfho_in.hooknum = NF_INET_LOCAL_IN; // netfilter hook for local machine bounded ipv4 packets
nfho_in.pf = PF_INET;
nfho_in.priority = NF_IP_PRI_FIRST; // we set its priority higher than other hooks
nf_register_hook(&nfho_in);
I tried to compile my module and got a compilation error:
error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types] nfho_in.hook = minifw_inbound_filter; // filter for inbound packets
What I'm doing wrong?
Thank you in advance!