public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Antonio Quartulli <ordex@autistici.org>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [PATCHv2 1/7] batman-adv: Return reason for failure in batadv_check_unicast_packet()
Date: Sat, 15 Dec 2012 13:39:35 +0100	[thread overview]
Message-ID: <20121215123935.GA10690@ritirata.org> (raw)
In-Reply-To: <201212151610.17929.lindner_marek@yahoo.de>

[-- Attachment #1: Type: text/plain, Size: 1634 bytes --]

On Sat, Dec 15, 2012 at 04:10:17PM +0800, Marek Lindner wrote:
> 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.

If I am not mistaken you only use "-4" in your network coding code. Maybe you
want to reduce this distinction to two cases only?

e.g.
* -EINVAL : incorrect header or bad fields (-1, -2, -3)..the packet is not valid
  in the end
* something else for your case..what about -EREMOTE ?


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

I agree on this. It would simplify your daily rebasing task. And when/if you do
so, remember to change the commit message: networking does not exist yet.

Cheers,


-- 
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-12-15 12:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-14  6:32 [B.A.T.M.A.N.] [PATCHv2 0/7] CATWOMAN: Network coding in batman-adv Martin Hundebøll
2012-12-14  6:32 ` [B.A.T.M.A.N.] [PATCHv2 1/7] batman-adv: Return reason for failure in batadv_check_unicast_packet() Martin Hundebøll
2012-12-15  8:10   ` Marek Lindner
2012-12-15 12:39     ` Antonio Quartulli [this message]
2012-12-14  6:32 ` [B.A.T.M.A.N.] [PATCHv2 2/7] batman-adv: Add the initial code for network coding Martin Hundebøll
2012-12-15 13:15   ` Antonio Quartulli
2012-12-14  6:32 ` [B.A.T.M.A.N.] [PATCHv2 3/7] batman-adv: Detect coding nodes and remove these after timeout Martin Hundebøll
2012-12-18 22:54   ` Antonio Quartulli
2012-12-14  6:32 ` [B.A.T.M.A.N.] [PATCHv2 4/7] batman-adv: Buffer unicast packets before forward Martin Hundebøll
2012-12-18 22:54   ` Antonio Quartulli
2012-12-14  6:32 ` [B.A.T.M.A.N.] [PATCHv2 5/7] batman-adv: Code and transmit packets if possible Martin Hundebøll
2012-12-14  6:32 ` [B.A.T.M.A.N.] [PATCHv2 6/7] batman-adv: Save overheard and tx packets for decoding Martin Hundebøll
2012-12-14  6:32 ` [B.A.T.M.A.N.] [PATCHv2 7/7] batman-adv: Receive coded packets and decode them Martin Hundebøll
2012-12-15  8:13 ` [B.A.T.M.A.N.] [PATCHv2 0/7] CATWOMAN: Network coding in batman-adv Marek Lindner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121215123935.GA10690@ritirata.org \
    --to=ordex@autistici.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox