Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 186589 | Differences between
and this patch

Collapse All | Expand All

(-)arp.c (-4 / +12 lines)
Lines 190-206 Link Here
190
				continue;
190
				continue;
191
			if (reply->ar_pln != sizeof (struct in_addr))
191
			if (reply->ar_pln != sizeof (struct in_addr))
192
				continue;
192
				continue;
193
194
			if (reply->ar_hln != ETHER_ADDR_LEN)
195
				continue;
196
			if ((unsigned) bytes < sizeof (reply) + 
193
			if ((unsigned) bytes < sizeof (reply) + 
197
				2 * (4 + reply->ar_hln))
194
				2 * (4 + reply->ar_hln))
198
				continue;
195
				continue;
199
196
200
			rp.c = (unsigned char *) ar_spa (reply);
197
			rp.c = (unsigned char *) ar_spa (reply);
201
			rh.c = (unsigned char *) ar_sha (reply);
198
			rh.c = (unsigned char *) ar_sha (reply);
199
			
200
			/* Ensure the ARP reply is for the address we asked for */
201
			if (rp.a->s_addr != address.s_addr)
202
				continue;
203
204
			/* Some systems send a reply back from our hwaddress - weird */
205
			if (reply->ar_hln == iface->hwlen &&
206
				memcmp (rh.c, iface->hwaddr, iface->hwlen) == 0)
207
				continue;
208
202
			logger (LOG_ERR, "ARPOP_REPLY received from %s (%s)",
209
			logger (LOG_ERR, "ARPOP_REPLY received from %s (%s)",
203
					inet_ntoa (*rp.a), ether_ntoa (rh.a));
210
					inet_ntoa (*rp.a),
211
					hwaddr_ntoa (rh.c, reply->ar_hln));
204
			retval = -1;
212
			retval = -1;
205
			goto eexit;
213
			goto eexit;
206
		}
214
		}

Return to bug 186589