Converting rt_key(2.4) to flowi (2.6)

From: Morfean (vinayvinay_at_gmail.com)
Date: 02/15/05


Date: 15 Feb 2005 03:14:19 -0800

Hi,
I am trying to port a networking protocol from kernel 2.4 to 2.6. I
couldn't figure out the equivalent of struct rt_key in 2.6.

struct rtable *rt;

code in 2.4:
struct rt_key key = { dst:dst,
                        src:src,
                        oif:skb->sk ? skb->sk->bound_dev_if : 0,
                        tos:RT_TOS(iph->tos)|RTO_CONN,
};

code in 2.6 that I tried:
struct flowi key = {
          .oif = sk? sk->sk_bound_dev_if:0,
          .nl_u = { .ip4_u =
                        { .daddr = dst,
                         .tos=RT_TOS(iph->tos)|RTO_CONN,
                         .saddr = src,
                         .scope = RT_SCOPE_UNIVERSE,
                        }
          }
};

flowi has the ip address of the next hop machine. After this
ip_route_output_key(&rt, &key) is called, which is expected to fill in
the dst structure in 'rt'. But ip_route_output_key fails. It returns
-22. Could you please tell me what the problem is? Any help will be
appreciated.

Regards,
Vinay



Relevant Pages

  • Gcov-kernel patch update for 2.6.0-test3
    ... Here's another resync of the kernel patch (originally by Hubertus Franke ... and Rajan Ravindran) to allow the gcov coverage analysis tool to be used ... * The .ctors-section contains a list of pointers to constructor ... static struct memchunk *freechunks; ...
    (Linux-Kernel)
  • [RFC v3][PATCH 2/2] intel_txt: Intel(R) TXT and tboot kernel support
    ... Linux support for IntelTrusted Execution Technology. ... struct boot_params { ... shared data structure with tboot and kernel and functions ... +Trusted Boot (tboot) is an open source, pre- kernel/VMM module that uses Intel ...
    (Linux-Kernel)
  • [RFC v4][PATCH 2/2] intel_txt: Intel(R) TXT and tboot kernel support
    ... Linux support for IntelTrusted Execution Technology. ... struct boot_params { ... * tboot.h: shared data structure with tboot and kernel and functions ...
    (Linux-Kernel)
  • Re: [HP ProLiant WatchDog driver] hpwdt HP WatchDog Patch
    ... specific HW Timer located in the HP ProLiant iLO 2 ASIC. ... development kernel. ... `struct SMBIOS_entry_point' would be more typical. ... +hpwdt_ioctl(struct file *file, unsigned int cmd, ...
    (Linux-Kernel)
  • [PATCH 2 of 18] ipath - core driver header files
    ... ipath_debug.h contains mask values used for controlling driver debugging. ... * to communicate between kernel and user code. ... * This struct must have explict pad fields where type sizes ... * We could have a single register get/put routine, that takes a group type, ...
    (Linux-Kernel)