ow to intercept an udp packet sent by a socket in a Netfilter module

Olivier GRALL olivier.grall at neotip.com
Thu Dec 23 11:02:46 CET 2004


Hello

I'm writing a little module using netfilter. I want to catch an UDP 
packet sended by a socket and to change its source port without 
conntrack see the changes. I want to do it on the POSTROUTING Hook but I 
don't see any packets from a socket in my module logs.

So I want to know how to capture packets coming from a local socket in 
POSTROUTING.

For the moment, I register like this:
    static struct nf_hook_ops ipt_ops_out =
    {
      { NULL, NULL},
      ms_media_hook_out,
      THIS_MODULE,
      PF_INET,
      NF_IP_POST_ROUTING,
      NF_IP_PRI_NAT_SRC+1
    };

Thanks,

Olivier GRALL






More information about the netfilter-devel mailing list