b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Marek Lindner <lindner_marek@yahoo.de>
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.] [PATCH] batman-adv: Update pointer to ethhdr after skb_copy
Date: Mon, 26 Apr 2010 16:59:19 +0800	[thread overview]
Message-ID: <201004261659.20055.lindner_marek@yahoo.de> (raw)
In-Reply-To: <1272237853-26242-1-git-send-email-sven.eckelmann@gmx.de>

On Monday 26 April 2010 07:24:13 Sven Eckelmann wrote:
> We must ensure that all pointer to a socket buffer are updated when we
> copy a socket buffer and free our reference to the old one.
> Another part of the kernel could also free its reference which maybe
> removes the buffer completely. In that situation we would would feed
> wrong information to the routing algorithm after the memory area is
> written again by someone else.

Good catch !


> @@ -960,6 +963,7 @@ int recv_icmp_packet(struct sk_buff *skb)
>  			if (!skb)
>  				return NET_RX_DROP;
>  			icmp_packet = (struct icmp_packet_rr *)skb->data;
> +			ethhdr = (struct ethhdr *)skb_mac_header(skb);
>  			kfree_skb(skb_old);
>  		}
> 
> @@ -1106,6 +1110,7 @@ int recv_unicast_packet(struct sk_buff *skb)
>  		if (!skb)
>  			return NET_RX_DROP;
>  		unicast_packet = (struct unicast_packet *) skb->data;
> +		ethhdr = (struct ethhdr *)skb_mac_header(skb);
>  		kfree_skb(skb_old);
>  	}

I was about to commit your patch when I fell over these last 2 changes. I 
can't see why we need them. What did I miss ?

Regards,
Marek


  reply	other threads:[~2010-04-26  8:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-25 23:24 [B.A.T.M.A.N.] [PATCH] batman-adv: Update pointer to ethhdr after skb_copy Sven Eckelmann
2010-04-26  8:59 ` Marek Lindner [this message]
2010-04-26  9:24   ` Sven Eckelmann
2010-04-26 10:27     ` 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=201004261659.20055.lindner_marek@yahoo.de \
    --to=lindner_marek@yahoo.de \
    --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;
as well as URLs for NNTP newsgroup(s).