* [B.A.T.M.A.N.] [PATCH maint] batman-adv: check return value of pskb_trim_rcsum()
@ 2013-05-07 11:25 Marek Lindner
2013-05-08 4:46 ` Martin Hundebøll
0 siblings, 1 reply; 3+ messages in thread
From: Marek Lindner @ 2013-05-07 11:25 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Marek Lindner
Reported-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
---
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;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH maint] batman-adv: check return value of pskb_trim_rcsum()
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
2013-05-09 7:50 ` Marek Lindner
0 siblings, 1 reply; 3+ messages in thread
From: Martin Hundebøll @ 2013-05-08 4:46 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking; +Cc: Marek Lindner
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH maint] batman-adv: check return value of pskb_trim_rcsum()
2013-05-08 4:46 ` Martin Hundebøll
@ 2013-05-09 7:50 ` Marek Lindner
0 siblings, 0 replies; 3+ messages in thread
From: Marek Lindner @ 2013-05-09 7:50 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
On Wednesday, May 08, 2013 12:46:53 Martin Hundebøll wrote:
> 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>
Applied in revision d22ebef.
Regards,
Marek
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-05-09 7:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2013-05-09 7:50 ` Marek Lindner
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.