study

Reception of unsolicited arp

2.4에서는 unsolicited ARP reply 수신 여부를 커널 빌드 옵션으로 결정했지만 2.6에서는 proc의 arp_accept 값으로 선택할 수 있다.

 

kernel 2.4

#ifdef CONFIG_IP_ACCEPT_UNSOLICITED_ARP
    /* Unsolicited ARP is not accepted by default.
       It is possible, that this option should be enabled for some
       devices (strip is candidate)
     */
    if (n == NULL && 
        arp->ar_op == htons(ARPOP_REPLY) &&
        inet_addr_type(sip) == RTN_UNICAST)
        n = __neigh_lookup(&arp_tbl, &sip, dev, -1);
#endif

kernel 2.6

    if (ipv4_devconf.arp_accept) {
        /* Unsolicited ARP is not accepted by default.
           It is possible, that this option should be enabled for some
           devices (strip is candidate)
         */
        if (n == NULL && 
            arp->ar_op == htons(ARPOP_REPLY) &&
            inet_addr_type(sip VRF_CALL_ARG(dev->vrf)) == RTN_UNICAST)
            n = __neigh_lookup(&arp_tbl, &sip, dev, 1);
    }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s