Determining the interface for an skb

James Morris (jmorris@intercode.com.au)
Sun, 26 Dec 1999 04:41:52 +1100 (EST)


Is there a simple method for determining which interface an skb is
being routed from or routed to?

Assume an ipv4 packet to be forwarded has arrived via the aliased
interface eth0:8.

It is possible to use something along the lines of:

struct in_ifaddr *ifa;
struct in_device *in_dev;

in_dev = __in_dev_get(skb->dev);
if (in_dev)
for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next)
printk("label=%s\n", ifa->ifa_label);

to obtain a listing of the interfaces associated with the device.

But I haven't been able to find an obvious way to determine which label is
correct for the packet, and would appreciate any clues.

- James.

--
James Morris
<jmorris@intercode.com.au>

- To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.rutgers.edu