Hi All,
I'm working on Linux 2.4.12 Kernel. My debugging starts when I couldnot get
netfilter/MIRROR module working. In the code, call of ip_route_output_key()
returns with value "-22". This code basically swaps daddr <-> saddr. I
decided to call that function ip_route_output_key() immediately after packet
enters into MIRROR module. But still it returns the same value, which is
error in routing. I'm helpless now as after 3 days I'm not able to location
the cause of error.
Here is portion of that code
static int route_mirror(struct sk_buff *skb)
{
struct iphdr *iph = skb->nh.iph;
struct rtable *rt;
int err;
struct rt_key key = {
dst:iph->daddr, src:iph->saddr,
oif:skb->sk ? skb->sk->bound_dev_if : 0,
tos:RT_TOS(iph->tos)|RTO_CONN,
#ifdef CONFIG_IP_ROUTE_FWMARK
fwmark:skb->nfmark
#endif
};
if ((err=ip_route_output_key(&rt, &key)) != 0) {
printk("route_mirror: No more route. error %d\n", err);
return err;
}
...
}
Any kind of help is greately appritiated.
-- Sumit