From: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
To: Santiago Garcia Mantinan <manty@manty.net>
Cc: linux-net@vger.kernel.org, Hannes Schulz <schulz@schwaar.com>,
marcelo.tosatti@cyclades.com, bridge@osdl.org,
Stephen Hemminger <shemminger@osdl.org>
Subject: [Bridge] Re: bridge breaks loopback on 2.4.22
Date: Mon, 6 Oct 2003 02:11:32 -0300 [thread overview]
Message-ID: <20031006051132.GD12912@conectiva.com.br> (raw)
In-Reply-To: <20031004155435.GB1174@man.beta.es>
Em Sat, Oct 04, 2003 at 05:54:35PM +0200, Santiago Garcia Mantinan escreveu:
> The problem went away when I replaced the bridge code in 2.4.22 with the one
> from 2.4.23-test6, so, after seing that this fixed the problem I did a diff
> and found that the only diffs were just two lines:
>
> diff -ru bridge.2422/br_forward.c bridge/br_forward.c
> --- bridge.2422/br_forward.c 2002-08-03 02:39:46.000000000 +0200
> +++ bridge/br_forward.c 2003-10-03 19:46:35.000000000 +0200
> @@ -59,6 +59,7 @@
>
> indev = skb->dev;
> skb->dev = to->dev;
> + skb->ip_summed = CHECKSUM_NONE;
>
> NF_HOOK(PF_BRIDGE, NF_BR_FORWARD, skb, indev, skb->dev,
> __br_forward_finish);
> diff -ru bridge.2422/br_stp_bpdu.c bridge/br_stp_bpdu.c
> --- bridge.2422/br_stp_bpdu.c 2003-08-25 13:44:44.000000000 +0200
> +++ bridge/br_stp_bpdu.c 2003-10-03 19:46:35.000000000 +0200
> @@ -194,6 +194,6 @@
> }
>
> err:
> - kfree(skb);
> + kfree_skb(skb);
> return 0;
> }
>
> So, now I'm asking myself, how can this bug that is fixed by these two lines
> in the bridge code, be affecting my loopback?
>
> Anybody can explain this, please?
>
> Thanks in advance and thanks for all your help as well.
Well, kfree_skb doesn't frees the sk_buff right away, it looks at its refcnt,
while kfree just puts the area in the pointer in the pool, back to be reused,
so what has happened most probably is that when the skb, that was being shared,
but is now freed by kfree hits the packet sniffer... b00m, or it is being used
for something else or is outright damaged, or both.
I.e. it should be freed after the packet sniffer is done with it, and most
importantly, with the proper destructor, kfree_skb.
- Arnaldo
next prev parent reply other threads:[~2003-10-06 5:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-27 20:22 [Bridge] bridge breaks loopback on 2.4.22 Santiago Garcia Mantinan
2003-09-27 20:22 ` Santiago Garcia Mantinan
2003-09-29 16:08 ` [Bridge] " Stephen Hemminger
2003-10-01 19:24 ` Santiago Garcia Mantinan
2003-10-01 12:51 ` [Bridge] " Marcelo Tosatti
2003-10-01 12:51 ` Marcelo Tosatti
2003-10-02 17:22 ` [Bridge] " Hannes Schulz
2003-10-02 23:00 ` Stephen Hemminger
2003-10-04 15:54 ` Santiago Garcia Mantinan
2003-10-06 5:11 ` Arnaldo Carvalho de Melo [this message]
2003-10-06 14:31 ` Santiago Garcia Mantinan
2003-10-04 15:29 ` Santiago Garcia Mantinan
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=20031006051132.GD12912@conectiva.com.br \
--to=acme@conectiva.com.br \
--cc=bridge@osdl.org \
--cc=linux-net@vger.kernel.org \
--cc=manty@manty.net \
--cc=marcelo.tosatti@cyclades.com \
--cc=schulz@schwaar.com \
--cc=shemminger@osdl.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 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.