[Beowulf] How to judge whether an ip address is local or not
spacetiller at 163.com
Mon Aug 15 18:08:36 PDT 2005
>> > I need to judge whether an ip address is local in kernel state.
>> > Can anyone help me?
>> > Great appreciation to any apply.
>> What do you mean by "local"? There are all sorts of ways to learn all
>> sorts of pieces of information about ip addresses and network
>I thought the query was really "how can I tell if an IP is local,
>xor if it requires going through a router". I have no idea what
>the reference to "kernel state" means - obviously the kernel uses
>the same sequence of increasingly specific routes to determine how
>to handle a packet. the routes are not privileged (/sbin/ip route show
>works fine as a normal user)
Sorry for the confusion i have brought.
I intended to find a method to judge whether the destination ip address of a packet received is one of the ip addresses the receiving machine has.And this packet is intercepted by my netfilter prog(LKM,in "kernel state" of course) at the NF_IP_PRE_ROUTING point.Originally I judge the pkt_type of the skb packet,but i'm not sure when and where the skb->pkt_type is changed since being received by the NIC.Maybe no change happens since the skb is constructed at the sending machine?
And, i have known how a bad subject has twisted your brain, thx a lot^^.
= = = = = = = = = = = = = = = = = = = =
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡spacetiller at 163.com
More information about the Beowulf