Sponsored Content
Full Discussion: multiple arp replies
Special Forums IP Networking multiple arp replies Post 82279 by Rakesh Ranjan on Tuesday 30th of August 2005 12:28:42 PM
Old 08-30-2005
May b I'm not clear so let me clear I have built packet socket (PF_PACKET) which catches all the arp packets coming to its interface. Now as I know the ARP packets are broadcasted on the network and when it comes to a particular machine it checks if the destination field (ar_tip & ar_tpa) in the ARP header are meant for it or not now I know the callers IP address and hardware address (ar_sip & ar_spa in request) so I can easily forge the machine the sender requested and send an appropriate ARP reply.

Now my question was if not just one but many machine try to forge like this what would happen.
But I got my answer (google is great!!) that only the first (the fastest) reply is taken.

But I still have a problem,more general , I'm using above said thing in my application but when I'm using recvfrom to get the clients address ( in sockaddr_in structure argument with length in length field ) I'm not able to get it correctly I mean when I'm using inet_ntoa to convert sin_addr structure of got address(in sockaddr_in client) to corresponding IP address the result is not same as I got in ARP header. Even in just a simple UDP packet I'm not able to get the address correctly.
Can u suggest something.
 

7 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Diappearing Replies

I have seen some in some threads it shows that are more than 1 replies, but when i open the thread for reading it it shows me only one reply. Where have the other replies gone ? (2 Replies)
Discussion started by: kapilv
2 Replies

2. IP Networking

multiple ping replies

Helo ! I set up a new server using FreeBSD 6.0-RELEASE. Everything is ok, until I try to connect it to the internet. After I set up the connection I try to ping yahoo.com and I don't get any reply. When I try to ping the gateway I get a lot of replyes for the same packet. It looks similar to this:... (2 Replies)
Discussion started by: Sergiu-IT
2 Replies

3. Post Here to Contact Site Administrators and Moderators

How to see replies for my post !!!!!

Hi, I had post my queries regarding shared objects (.so) in this forum. But i cant able to see the replies. I doubt whether i had received any replies or not. Kindly help me, to know the procedure to see the replies for my queries. Thankyou. Regards, Senthil. (1 Reply)
Discussion started by: senthilvnr
1 Replies

4. Post Here to Contact Site Administrators and Moderators

Not getting email for the replies

Hi Admin, From the past couple of days, I'm not getting any emails for the replies made for my posts... How can this be resolved, I checked my email address and it is correct... could you please help me.. I missing many because of this problem Cheers..Mahendra (2 Replies)
Discussion started by: mahendramahendr
2 Replies

5. HP-UX

HW Address and arp

I was checking nettl output for a unstable telnet to my server. this is part of output: ### ***********************************STREAMS/UX*******************************@#% Timestamp : Sun Jun 22 EETDST 2008 22:14:47.492899 Process ID : Subsystem ... (4 Replies)
Discussion started by: xramm
4 Replies

6. UNIX for Advanced & Expert Users

arp questions

Can someone please explain this output to me. Why doesn't ifconfig show the same info? ~ $ arp -a ? (10.71.0.1) at 00:1b:21:2b:eb:0c on eth0 (4 Replies)
Discussion started by: cokedude
4 Replies

7. War Stories

What arp -s is good for

A customer appears to have drastically misunderstood our instructions for connecting to our WAN. He set his PC IP address to the same as one of the bridges. :mad: :wall: This caused much confusion on the network, to put it mildly. He called to complain about the poor performance of the network... (13 Replies)
Discussion started by: Corona688
13 Replies
ARP(9)							   BSD Kernel Developer's Manual						    ARP(9)

NAME
arp, arp_ifinit, arpresolve, arpintr -- externally visible ARP functions SYNOPSIS
#include <netinet/if_inarp.h> void arp_ifinit(struct ifnet *ifp, struct ifaddr *ifa); int arpresolve(struct ifnet *ifp, struct rtentry *rt, struct mbuf *m, struct sockaddr *dst, u_char *desten); void arpintr(); DESCRIPTION
The arp functions provide the interface between the arp module and the network drivers which need arp functionality. Such drivers must request the arp attribute in their "files" declaration. arp_ifinit() Sets up the arp specific fields in ifa. Additionally, it sends out a gratuitous arp request on ifp, so that other machines are warned that we have a (new) address and duplicate addresses can be detected. You must call this in your drivers' ioctl function when you get a SIOCSIFADDR request with an AF_INET address family. arpresolve() is called by network output functions to resolve an IPv4 address. If no rt is given, a new one is looked up or created. If the passed or found rt does not contain a valid gateway link level address, a pointer to the packet in m is stored in the route entry, possibly replacing older stored packets, and an arp request is sent instead. When an arp reply is received, the last held packet is send. Otherwise, the looked up address is returned and written into the storage desten points to. arpresolve() returns 1, if a valid address was stored to desten, and the packet can be sent immediately. Else a 0 is returned. arpintr() When an arp packet is received, the network driver (class) input interrupt handler queues the packet on the arpintrq queue, and requests an arpintr() soft interrupt callback. arpintr() dequeues the packets, performs sanity checks and calls (for IPv4 arp packets, which are the only ones supported currently) the in_arpinput() function. in_arpinput() either generates a reply to request packets, and adds the sender address translation to the routing table, if a matching route entry is found. If the route entry contained a pointer to a held packet, that packet is sent. SEE ALSO
ether_ifattach(9) Plummer, D., "RFC826", An Ethernet Address Resolution Protocol. STANDARDS
RFC 826 HISTORY
Rewritten to support other than Ethernet link level addresses in NetBSD 1.3. AUTHORS
UCB CSRG (original implementation) Ignatios Souvatzis (support for non-Ethernet) CODE REFERENCES
The ARP code is implemented in sys/net/if_arp.h, sys/netinet/if_inarp.h and sys/netinet/if_arp.c. BSD
March 3, 1997 BSD
All times are GMT -4. The time now is 04:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy