|
From: | Nicolas Pinault |
Subject: | Re: RE : RE : [lwip-users] Source MAC address |
Date: | Tue, 18 Dec 2007 09:20:15 +0100 |
User-agent: | Thunderbird 2.0.0.9 (Windows/20071031) |
Frédéric BERNON a écrit : You are right. The source address is not broadcast. The destination address is broadcast. But I can't rely on the source address when packets are broadcasted.Strange, a broadcast address as source ? Just for my information, which protocol need/use that ? Here is my problem : - My system communicates with a WinXP PC. - Sometimes, the PC broadcasts packets to my system. - If the PC has more than one network interface, the source address of the broadcasted packet may not be the IP address of the network interface that has sent the packet. For example, the PC has an ethernet card, a WIFI card and a Bluetooth card (quite standart today). - Ethernet is on 192.168.2.10 - WIFI is on 192.168.3.10 - Bluetooth is on 192.168.4.10 When the program running on the PC broadcasts a packet on Ethernet, source address of the packet can be 192.168.2.10 or 192.168.3.10 or 192.168.4.10. I thought it would be 192.168.2.10 but this is not allways the case. In this situation, my device running lwip can't reply to the sender with it's IP address since the source address of the broadcast packet is "false". So, the knowledge of the MAC address of the sender of the broadcast packet would let me find the "real" IP address of the sender (with ARP cache). Nicolas ==================================== Frédéric BERNON HYMATOM SA Chef de projet informatique Microsoft Certified Professional Tél. : +33 (0)4-67-87-61-10 Fax. : +33 (0)4-67-70-85-44 Email : address@hidden Web Site : http://www.hymatom.fr ==================================== P Avant d'imprimer, penser à l'environnement -----Message d'origine----- De : address@hidden [mailto:address@hidden] De la part de Nicolas Pinault Envoyé : mardi 18 décembre 2007 08:50 À : Mailing list for lwIP users Objet : Re: RE : [lwip-users] Source MAC address Hi, Frédéric BERNON a écrit :Hi, I think you could use etharp_find_addr to read the ARP table :Sorry but I can't since sometimes source IP address is broadcast (255.255.255.255). Nicolass /** * Finds (stable) ethernet/IP address pair from ARP table * using interface and IP address index. * @note the addresses in the ARP table are in network order! * * @param netif points to interface index * @param ipaddr points to the (network order) IP address index * @param eth_ret points to return pointer * @param ip_ret points to return pointer * @return table index if found, -1 otherwise */ s8_t etharp_find_addr(struct netif *netif, struct ip_addr *ipaddr, struct eth_addr **eth_ret, struct ip_addr **ip_ret); ==================================== Frédéric BERNON HYMATOM SA Chef de projet informatique Microsoft Certified Professional Tél. : +33 (0)4-67-87-61-10 Fax. : +33 (0)4-67-70-85-44 Email : address@hidden Web Site : http://www.hymatom.fr ==================================== P Avant d'imprimer, penser à l'environnement -----Message d'origine----- De : address@hidden [mailto:address@hidden] De la part de Nicolas Pinault Envoyé : lundi 17 décembre 2007 17:00 À : Mailing list for lwIP users Objet : [lwip-users] Source MAC address Hi all, My system uses non connected sockets (UDP) to get data from other machines. Some packets are received thru broadcast address (255.255.255.255). In the thread wich manages the rx socket, I'd like to know the sender MAC address. I allready have the sender IP address but that is not what I want. It seems it is not posible to get this information without a big modification of lwip. I am wrong ? Nicolas _______________________________________________ lwip-users mailing list address@hidden http://lists.nongnu.org/mailman/listinfo/lwip-users _______________________________________________ lwip-users mailing list address@hidden http://lists.nongnu.org/mailman/listinfo/lwip-users_______________________________________________ lwip-users mailing list address@hidden http://lists.nongnu.org/mailman/listinfo/lwip-users |
[Prev in Thread] | Current Thread | [Next in Thread] |