From: Ihar Hrachyshka <[email protected]>
Date: Tue,  9 May 2017 17:16:07 -0700

> @@ -842,8 +844,20 @@ static int arp_process(struct net *net, struct sock *sk, 
> struct sk_buff *skb)
>                  It is possible, that this option should be enabled for some
>                  devices (strip is candidate)
>                */
> -             is_garp = arp->ar_op == htons(ARPOP_REQUEST) && tip == sip &&
> -                       addr_type == RTN_UNICAST;
> +             is_garp = tip == sip && addr_type == RTN_UNICAST;
> +
> +             /* Unsolicited ARP _replies_ also require target hwaddr to be
> +              * the same as source.
> +              */
> +             if (is_garp && arp->ar_op == htons(ARPOP_REPLY))
> +                     is_garp =
> +#if IS_ENABLED(CONFIG_FIREWIRE_NET)
> +                             /* IPv4 over IEEE 1394 doesn't provide target
> +                              * hardware address field in its ARP payload.
> +                              */
> +                             tha &&
> +#endif
> +                             !memcmp(tha, sha, dev->addr_len);
>  

The ifdefs here make the test harder to understand.

I would suggest removing the ifdef and letting the compiler remove the 'tha'
check if it can.

Thank you.

Reply via email to