public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: "Martin Hundebøll" <martin@hundeboll.net>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Cc: Marek Lindner <lindner_marek@yahoo.de>
Subject: Re: [B.A.T.M.A.N.] [PATCH maint] batman-adv: check return value of pskb_trim_rcsum()
Date: Wed, 08 May 2013 06:46:53 +0200	[thread overview]
Message-ID: <5189D8BD.8070500@hundeboll.net> (raw)
In-Reply-To: <1367925902-31578-1-git-send-email-lindner_marek@yahoo.de>

On 2013-05-07 13:25, Marek Lindner wrote:
> Reported-by: Sven Eckelmann <sven@narfation.org>
> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>

Acked-by: Martin Hundebøll <martin@hundeboll.net>

> ---
>   network-coding.c |    8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/network-coding.c b/network-coding.c
> index f7c5430..e84629e 100644
> --- a/network-coding.c
> +++ b/network-coding.c
> @@ -1514,6 +1514,7 @@ batadv_nc_skb_decode_packet(struct batadv_priv *bat_priv, struct sk_buff *skb,
>   	struct ethhdr *ethhdr, ethhdr_tmp;
>   	uint8_t *orig_dest, ttl, ttvn;
>   	unsigned int coding_len;
> +	int err;
>
>   	/* Save headers temporarily */
>   	memcpy(&coded_packet_tmp, skb->data, sizeof(coded_packet_tmp));
> @@ -1568,8 +1569,11 @@ batadv_nc_skb_decode_packet(struct batadv_priv *bat_priv, struct sk_buff *skb,
>   			 coding_len);
>
>   	/* Resize decoded skb if decoded with larger packet */
> -	if (nc_packet->skb->len > coding_len + h_size)
> -		pskb_trim_rcsum(skb, coding_len + h_size);
> +	if (nc_packet->skb->len > coding_len + h_size) {
> +		err = pskb_trim_rcsum(skb, coding_len + h_size);
> +		if (err)
> +			return NULL;
> +	}
>
>   	/* Create decoded unicast packet */
>   	unicast_packet = (struct batadv_unicast_packet *)skb->data;
>


-- 
Kind Regards
Martin Hundebøll
Frederiks Allé 99, 1.th
8000 Aarhus C
Denmark

+45 61 65 54 61
martin@hundeboll.net

  reply	other threads:[~2013-05-08  4:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-07 11:25 [B.A.T.M.A.N.] [PATCH maint] batman-adv: check return value of pskb_trim_rcsum() Marek Lindner
2013-05-08  4:46 ` Martin Hundebøll [this message]
2013-05-09  7:50   ` 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=5189D8BD.8070500@hundeboll.net \
    --to=martin@hundeboll.net \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=lindner_marek@yahoo.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