summaryrefslogtreecommitdiff
path: root/net/atm/br2684.c
diff options
context:
space:
mode:
authorJorge Boncompte [DTI2] <jorge@dti2.net>2011-11-21 10:25:57 +0000
committerDavid S. Miller <davem@davemloft.net>2011-11-22 16:15:42 -0500
commit4e55f5785825f18b1eb6c5cc5a9717e276925805 (patch)
tree31a7c44400e598e82e1de0a7326952d00b28767d /net/atm/br2684.c
parent3b829366cc6d0adeb4df2c2d917926f6b41c573d (diff)
atm: Introduce vcc_process_recv_queue
This function moves the implementation found in the clip and br2684 modules to common code, correctly unlinks the skb from the queue before pushing it and makes pppoatm use it. Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/atm/br2684.c')
-rw-r--r--net/atm/br2684.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index 81cf33b1527d..53b0aa14a1e6 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -489,15 +489,11 @@ free_skb:
*/
static int br2684_regvcc(struct atm_vcc *atmvcc, void __user * arg)
{
- struct sk_buff_head queue;
- int err;
struct br2684_vcc *brvcc;
- struct sk_buff *skb, *tmp;
- struct sk_buff_head *rq;
struct br2684_dev *brdev;
struct net_device *net_dev;
struct atm_backend_br2684 be;
- unsigned long flags;
+ int err;
if (copy_from_user(&be, arg, sizeof be))
return -EFAULT;
@@ -550,16 +546,6 @@ static int br2684_regvcc(struct atm_vcc *atmvcc, void __user * arg)
atmvcc->push = br2684_push;
atmvcc->pop = br2684_pop;
- __skb_queue_head_init(&queue);
- rq = &sk_atm(atmvcc)->sk_receive_queue;
-
- spin_lock_irqsave(&rq->lock, flags);
- skb_queue_splice_init(rq, &queue);
- spin_unlock_irqrestore(&rq->lock, flags);
-
- skb_queue_walk_safe(&queue, skb, tmp)
- br2684_push(atmvcc, skb);
-
/* initialize netdev carrier state */
if (atmvcc->dev->signal == ATM_PHY_SIG_LOST)
netif_carrier_off(net_dev);
@@ -567,6 +553,10 @@ static int br2684_regvcc(struct atm_vcc *atmvcc, void __user * arg)
netif_carrier_on(net_dev);
__module_get(THIS_MODULE);
+
+ /* re-process everything received between connection setup and
+ backend setup */
+ vcc_process_recv_queue(atmvcc);
return 0;
error: