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 / +11 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
197
			/* Ensure the ARP reply is for the address we asked for */
198
			if (rp.a->s_addr != address.s_addr)
199
				continue;
200
201
			/* Some systems send a reply back from our hwaddress - weird */
202
			if (reply->ar_hln == iface->hwlen &&
203
				memcmp (rh.c, iface->hwaddr, iface->hwlen) == 0)
204
				continue;
205
200
			rp.c = (unsigned char *) ar_spa (reply);
206
			rp.c = (unsigned char *) ar_spa (reply);
201
			rh.c = (unsigned char *) ar_sha (reply);
207
			rh.c = (unsigned char *) ar_sha (reply);
202
			logger (LOG_ERR, "ARPOP_REPLY received from %s (%s)",
208
			logger (LOG_ERR, "ARPOP_REPLY received from %s (%s)",
203
					inet_ntoa (*rp.a), ether_ntoa (rh.a));
209
					inet_ntoa (*rp.a),
210
					hwaddr_ntoa (rh.c, reply->ar_hln));
204
			retval = -1;
211
			retval = -1;
205
			goto eexit;
212
			goto eexit;
206
		}
213
		}

Return to bug 186589