Linux ARP code

Why this is the default ARP behaviour in Linux (net/ipv4/arp.c) is beyond me:

static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb)
{
     ...blah blah blah...
	switch (IN_DEV_ARP_ANNOUNCE(in_dev)) {
	default:
	case 0:		/* By default announce any local IP */
		if (skb && inet_addr_type(skb->nh.iph->saddr) == RTN_LOCAL)
			saddr = skb->nh.iph->saddr;
		break;
      ...blah blah blah...
	arp_send(ARPOP_REQUEST, ETH_P_ARP, target, dev, saddr,
		 dst_ha, dev->dev_addr, NULL);

Use any local address, configured on any interface as the source IP address? Yikes!


About this entry