Netdev List
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Andrew Morton <akpm@osdl.org>, "David S. Miller" <davem@davemloft.net>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	netdev@vger.kernel.org
Subject: [PATCH 3/5] llc: allow applications to get copy of kernel datagrams (redo)
Date: Wed, 31 May 2006 10:00:39 -0700	[thread overview]
Message-ID: <20060531100039.5bce8cd6@dxpl.pdx.osdl.net> (raw)
In-Reply-To: <20060524000530.269796000@localhost.localdomain>

It is legal for an application to bind to a SAP that is also being
used by the kernel. This happens if the bridge module binds to the
STP SAP, and the user wants to have a daemon for STP as well.
It is possible to have kernel doing STP on one bridge, but
let application do RSTP on another bridge.

Previous version of the patch was broken and called rcv() twice.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>

--- br.orig/net/llc/llc_input.c
+++ br/net/llc/llc_input.c
@@ -173,8 +173,11 @@ int llc_rcv(struct sk_buff *skb, struct 
 	 */
 	rcv = rcu_dereference(sap->rcv_func);
 	if (rcv) {
-		rcv(skb, dev, pt, orig_dev);
-		goto out_put;
+ 		struct sk_buff *skb2;
+
+		skb2 = skb_clone(skb, GFP_ATOMIC);
+ 		if (skb2)
+ 			rcv(skb2, dev, pt, orig_dev);
 	}
 	dest = llc_pdu_type(skb);
 	if (unlikely(!dest || !llc_type_handlers[dest - 1]))

  reply	other threads:[~2006-05-31 17:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-24  0:04 [PATCH 0/5] LLC SOCK_DGRAM enhancements Stephen Hemminger
2006-05-24  0:04 ` [PATCH 1/5] llc: allow datagram recvmsg Stephen Hemminger
2006-05-24  0:04 ` [PATCH 2/5] llc: use rcu_dereference on receive handler Stephen Hemminger
2006-05-24  0:04 ` [PATCH 3/5] llc: allow applications to get copy of kernel datagrams Stephen Hemminger
2006-05-31 17:00   ` Stephen Hemminger [this message]
2006-05-24  0:04 ` [PATCH 4/5] llc: use more efficient ether address routines Stephen Hemminger
2006-05-24  0:04 ` [PATCH 5/5] llc: add multicast support for datagrams Stephen Hemminger
2006-05-25 22:11 ` [PATCH 0/5] LLC SOCK_DGRAM enhancements David Miller

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=20060531100039.5bce8cd6@dxpl.pdx.osdl.net \
    --to=shemminger@osdl.org \
    --cc=acme@ghostprotocols.net \
    --cc=akpm@osdl.org \
    --cc=davem@davemloft.net \
    --cc=netdev@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