linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jukka Rissanen <jukka.rissanen@linux.intel.com>
To: Alexander Aring <alex.aring@gmail.com>
Cc: linux-wpan@vger.kernel.org, kernel@pengutronix.de,
	linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH bluetooth-next 3/6] 6lowpan: introduce LOWPAN_IPHC_MAX_HC_BUF_LEN
Date: Fri, 16 Oct 2015 15:40:54 +0300	[thread overview]
Message-ID: <1444999254.3652.10.camel@linux.intel.com> (raw)
In-Reply-To: <1444736579-27826-3-git-send-email-alex.aring@gmail.com>

Hi Alex,

Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>


On ti, 2015-10-13 at 13:42 +0200, Alexander Aring wrote:
> This patch introduces the LOWPAN_IPHC_MAX_HC_BUF_LEN define which
> represent the worst-case supported IPHC buffer length. It's used to
> allocate the stack buffer space for creating the IPHC header.
> 
> Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> ---
>  include/net/6lowpan.h | 8 ++++++++
>  net/6lowpan/iphc.c    | 2 +-
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/include/net/6lowpan.h b/include/net/6lowpan.h
> index 07db532..aa5a823 100644
> --- a/include/net/6lowpan.h
> +++ b/include/net/6lowpan.h
> @@ -64,12 +64,20 @@
>  #define EUI64_ADDR_LEN		8
>  
>  #define LOWPAN_NHC_MAX_ID_LEN	1
> +/* Maximum next header compression length which we currently support inclusive
> + * possible inline data.
> + */
> +#define LOWPAN_NHC_MAX_HDR_LEN	(sizeof(struct udphdr))
>  /* Max IPHC Header len without IPv6 hdr specific inline data.
>   * Useful for getting the "extra" bytes we need at worst case compression.
>   *
>   * LOWPAN_IPHC + CID + LOWPAN_NHC_MAX_ID_LEN
>   */
>  #define LOWPAN_IPHC_MAX_HEADER_LEN	(2 + 1 + LOWPAN_NHC_MAX_ID_LEN)
> +/* Maximum worst case IPHC header buffer size */
> +#define LOWPAN_IPHC_MAX_HC_BUF_LEN	(sizeof(struct ipv6hdr) +	\
> +					 LOWPAN_IPHC_MAX_HEADER_LEN +	\
> +					 LOWPAN_NHC_MAX_HDR_LEN)
>  
>  /*
>   * ipv6 address based on mac
> diff --git a/net/6lowpan/iphc.c b/net/6lowpan/iphc.c
> index 78c8a49..dd5f27d 100644
> --- a/net/6lowpan/iphc.c
> +++ b/net/6lowpan/iphc.c
> @@ -429,7 +429,7 @@ int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
>  {
>  	u8 tmp, iphc0, iphc1, *hc_ptr;
>  	struct ipv6hdr *hdr;
> -	u8 head[100] = {};
> +	u8 head[LOWPAN_IPHC_MAX_HC_BUF_LEN] = {};
>  	int ret, addr_type;
>  
>  	if (type != ETH_P_IPV6)


Cheers,
Jukka



  reply	other threads:[~2015-10-16 12:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-13 11:42 [PATCH bluetooth-next 1/6] mac802154: llsec: use kzfree Alexander Aring
2015-10-13 11:42 ` [PATCH bluetooth-next 2/6] bluetooth: 6lowpan: use lowpan dispatch helpers Alexander Aring
2015-10-13 13:02   ` Jukka Rissanen
2015-10-16 12:38   ` Jukka Rissanen
2015-10-13 11:42 ` [PATCH bluetooth-next 3/6] 6lowpan: introduce LOWPAN_IPHC_MAX_HC_BUF_LEN Alexander Aring
2015-10-16 12:40   ` Jukka Rissanen [this message]
2015-10-13 11:42 ` [PATCH bluetooth-next 4/6] 6lowpan: cleanup lowpan_header_compress Alexander Aring
2015-10-16 12:41   ` Jukka Rissanen
2015-10-13 11:42 ` [PATCH bluetooth-next 5/6] 6lowpan: cleanup lowpan_header_decompress Alexander Aring
2015-10-16 12:43   ` Jukka Rissanen
2015-10-13 11:42 ` [PATCH bluetooth-next 6/6] 6lowpan: remove lowpan_fetch_skb_u8 Alexander Aring
2015-10-16 12:44   ` Jukka Rissanen
2015-10-20  8:04 ` [PATCH bluetooth-next 1/6] mac802154: llsec: use kzfree Marcel Holtmann

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=1444999254.3652.10.camel@linux.intel.com \
    --to=jukka.rissanen@linux.intel.com \
    --cc=alex.aring@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-wpan@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).