NIC adress of incoming socket.

RosalieM NOSPAM at easyconnect.fr
Sat May 15 05:17:52 EDT 2004


"Peter Hansen" <peter at engcorp.com> a écrit dans le message de
news:naWdnRu54vmoBTjdRVn-hw at powergate.ca...
> RosalieM wrote:
>
> > How can i know the nic adress from an incoming socket ?
> > I can easily know the ip adress and port number but how do i have some
> > information about arp level ?
>
> In addition to Andreas' answer: I'm not even sure the problem
> has a well-defined solution in general.  Isn't it possible
> that individual packets in the data stream (assuming this
> is TCP, for example) can be routed through different
> networks (and, therefore, different NICs) on some machines?
>
> If you want to limit this to the simple case of one NIC
> per machine, then you still need to resort to platform-specific
> things like parsing the output of some external command
> to match up IP address and "NIC address" (which is also
> not necessarily well-defined, but I assume you mean Ethernet
> address there).
>
> -Peter

 I saw in dhcpd config for bootp that you give the adress of the nic. How
can i be sure that in my lan it is the right computer (my dhcp server) that
answers to my client and not another compromised machine ? Can i ask python
some information from ethernet level in an ip connection?





More information about the Python-list mailing list