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: b.a.t.m.a.n@lists.open-mesh.org
Cc: Antonio Quartulli <antonio@open-mesh.com>,
	Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Subject: Re: [B.A.T.M.A.N.] [PATCH] batman-adv: change VID semantic in the BLA code
Date: Wed, 3 Apr 2013 11:23:59 +0200	[thread overview]
Message-ID: <20130403092359.GD14372@ritirata.org> (raw)
In-Reply-To: <1364980634-8376-1-git-send-email-ordex@autistici.org>

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

On Wed, Apr 03, 2013 at 11:17:14AM +0200, Antonio Quartulli wrote:
> From: Antonio Quartulli <antonio@open-mesh.com>
> 
> In order to make batman-adv fully vlan aware later, the
> semantic used for variables storing the VLAN ID values has
> to be changed in order to be adapted to the new one which
> will be used batman-adv wide.
> 
> In particular, the VID has to be an "_unsigned_ short int"
> and its 4 MSB will be used as a flag bitfield, while the
> remaining 12 bits are used to store the real VID value
> 
> Cc: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
> Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>

[cut..]

> diff --git a/packet.h b/packet.h
> index a51ccfc..d5464f6 100644
> --- a/packet.h
> +++ b/packet.h
> @@ -105,6 +105,14 @@ enum batadv_tt_client_flags {
>  	BATADV_TT_CLIENT_PENDING = BIT(10),
>  };
>  
> +/**
> + * batadv_vlan_flags - flags for the four MSB of any vlan ID field
> + * @BATADV_VLAN_HAS_TAG: whether the field contains a valid vlan tag or not
> + */
> +enum batadv_vlan_flags {
> +	BATADV_VLAN_HAS_TAG	= BIT(15),
> +};
> +
>  /* claim frame types for the bridge loop avoidance */
>  enum batadv_bla_claimframe {
>  	BATADV_CLAIM_TYPE_CLAIM		= 0x00,
> diff --git a/soft-interface.c b/soft-interface.c
> index 403b8c4..34597a2 100644
> --- a/soft-interface.c
> +++ b/soft-interface.c
> @@ -154,7 +154,7 @@ static int batadv_interface_tx(struct sk_buff *skb,
>  						    0x00, 0x00};
>  	unsigned int header_len = 0;
>  	int data_len = skb->len, ret;
> -	short vid __maybe_unused = -1;
> +	unsigned short vid __maybe_unused = BATADV_NO_FLAGS;
>  	bool do_bcast = false;
>  	uint32_t seqno;
>  	unsigned long brd_delay = 1;
> @@ -303,7 +303,7 @@ void batadv_interface_rx(struct net_device *soft_iface,
>  	struct ethhdr *ethhdr;
>  	struct vlan_ethhdr *vhdr;
>  	struct batadv_header *batadv_header = (struct batadv_header *)skb->data;
> -	short vid __maybe_unused = -1;
> +	unsigned short vid __maybe_unused = BATADV_NO_FLAGS;
>  	__be16 ethertype = __constant_htons(ETH_P_BATMAN);
>  	bool is_bcast;

I just realised that this change is going to break compatibility because we
change the menaing of the value that BLA sends over the wire.

We must postpone this change to the next (BIG) compat bump.

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:[~2013-04-03  9:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-03  9:17 [B.A.T.M.A.N.] [PATCH] batman-adv: change VID semantic in the BLA code Antonio Quartulli
2013-04-03  9:23 ` Antonio Quartulli [this message]
2013-04-07 14:20   ` Simon Wunderlich
2013-04-07 15:05     ` Antonio Quartulli

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=20130403092359.GD14372@ritirata.org \
    --to=ordex@autistici.org \
    --cc=antonio@open-mesh.com \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=siwu@hrz.tu-chemnitz.de \
    /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