Re: How to get the ip address of the a net_device?

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

 



ipaddr = inet_select_addr(dev, 0 , 0) seems work for me.

Thanks a lot,
Jiangbo

On 9/1/05, Henrik Nordstrom <hno@xxxxxxxxxxxxxxx> wrote:
> On Tue, 30 Aug 2005, Jiangbo Li wrote:
> 
> > I am dealing with the Netfilter PreRouting hook. I want to write
> > current IP address into the packet. But I can not find a way to get
> > the IP address of the incoming device.
> 
> See the ipt_MASQUERATE.c for one example how to get the IP from a device.
> Not sure if this is applicable in your case however.. (MASQUERADE gets the
> preferred source IP from the routing related to the outgoing device).
> 
> Regards
> Henrik
>
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
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