Subject: Re: SNAT help

From: Asim Shankar <[email-masked]>
Date: Tue, 10 May 2005 12:12:20 -0500

> i have enabled SNAT and I have wrriten code
> at NF_IP_POST_ROUTING but i want to get outgoing
> packets' IP address as new one SNAT'ed IP address not
> the one that is before SNAT? How can i do that?

I think changing the priority (struct nf_hook_ops.priority) when
registering the hook would do your job. ip_nat_out_ops registers a
hook with a priority NF_IP_PRI_NAT_SRC.

If you register your hook with a priority greater than
NF_IP_PRI_NAT_SRC (like (NF_IP_PRI_NAT_SRC + 1) or NF_IP_PRI_LAST)
then your hook will be called after the ip_nat_out_ops hook.

Hope that helps,

-- Asim