Re: [B.A.T.M.A.N.] [PATCHv2 1/7] batman-adv: Return reason for failure in batadv_check_unicast_packet()

Marek Lindner
2012-12-15T08:10:17Z

On Friday, December 14, 2012 14:32:46 Martin Hundebøll wrote:
> static int batadv_check_unicast_packet(struct sk_buff *skb, int hdr_size)
> {
> struct ethhdr *ethhdr;
> @@ -564,15 +574,15 @@ static int batadv_check_unicast_packet(struct sk_buff
> *skb, int hdr_size)
>
> /* packet with unicast indication but broadcast recipient */
> if (is_broadcast_ether_addr(ethhdr->h_dest))
> - return -1;
> + return -2;
>
> /* packet with broadcast sender address */
> if (is_broadcast_ether_addr(ethhdr->h_source))
> - return -1;
> + return -3;
>
> /* not for me */
> if (!batadv_is_my_mac(ethhdr->h_dest))
> - return -1;
> + return -4;
>
> return 0;
> }

Returning meaningless numbers isn't the way to go. Either we make our own
defines or we re-use our E***** friends.

By the way, I suggest to send this patch separately. It increases the chance
of getting merged faster and reduces your patchset.

Cheers,
Marek