From 8f182b494f87799d6ae20a1401825c516da46081 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 25 May 2006 15:10:02 -0700 Subject: [LLC]: allow applications to get copy of kernel datagrams 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. Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller --- net/llc/llc_input.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/llc/llc_input.c b/net/llc/llc_input.c index cb9f7f058f75..32cf8ac8ea80 100644 --- a/net/llc/llc_input.c +++ b/net/llc/llc_input.c @@ -173,8 +173,10 @@ int llc_rcv(struct sk_buff *skb, struct net_device *dev, */ rcv = rcu_dereference(sap->rcv_func); if (rcv) { + struct sk_buff *cskb = skb_clone(skb, GFP_ATOMIC); + if (cskb) + rcv(cskb, dev, pt, orig_dev); rcv(skb, dev, pt, orig_dev); - goto out_put; } dest = llc_pdu_type(skb); if (unlikely(!dest || !llc_type_handlers[dest - 1])) -- cgit v1.2.3-59-g8ed1b