problem with ip_route_output_key

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

 



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

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux