--- zzzz-none-000/linux-2.4.17/drivers/net/ppp_generic.c 2001-10-11 16:18:31.000000000 +0000 +++ sangam-fb-322/linux-2.4.17/drivers/net/ppp_generic.c 2004-11-24 13:23:37.000000000 +0000 @@ -428,7 +428,14 @@ goto out; } - skb_queue_tail(&pf->xq, skb); + /* This is the control path and should not be classified by the QOS U32 classifiers. + * They work on the network header. So lets initialize it to NULL, since alloc_skb does + * not initialize this field. */ +#ifdef CONFIG_NET_SCH_PRIOWRR + skb->nh.raw = NULL; +#endif + + skb_queue_tail(&pf->xq, skb); switch (pf->kind) { case INTERFACE: @@ -887,7 +894,7 @@ dev->get_stats = ppp_net_stats; dev->do_ioctl = ppp_net_ioctl; dev->addr_len = 0; - dev->tx_queue_len = 3; + dev->tx_queue_len = 100; /* Changed from 3 to 100, for the PRIOWRR scheduler */ dev->type = ARPHRD_PPP; dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST; return 0; @@ -931,6 +938,8 @@ struct sk_buff *new_skb; int len; unsigned char *cp; + u32 *pport = NULL; + int skip = 0; if (proto < 0x8000) { #ifdef CONFIG_PPP_FILTER @@ -955,7 +964,12 @@ skb_pull(skb, 2); #else /* for data packets, record the time */ - ppp->last_xmit = jiffies; + pport = (u32 *)(skb->data + 2 + (skb->data[2] & 0x0F)*4); + if(( (((*pport)& 0x000000FF) << 8) | + (((*pport) & 0x0000FF00) >> 8) ) != 520) + ppp->last_xmit = jiffies; + else + skip = 1; #endif /* CONFIG_PPP_FILTER */ } @@ -1035,7 +1049,7 @@ * If we are waiting for traffic (demand dialling), * queue it up for pppd to receive. */ - if (ppp->flags & SC_LOOP_TRAFFIC) { + if (ppp->flags & SC_LOOP_TRAFFIC && ( skip != 1)) { if (ppp->file.rq.qlen > PPP_MAX_RQLEN) goto drop; skb_queue_tail(&ppp->file.rq, skb); @@ -1393,6 +1407,7 @@ { struct sk_buff *ns; int proto, len, npi; + u32 *pport = NULL; /* * Decompress the frame, if compressed. @@ -1485,13 +1500,35 @@ ppp->last_recv = jiffies; skb_pull(skb, 2); #else - ppp->last_recv = jiffies; + /* The IP header start at a 2 byte offset. We extract the + destination port field from the TCP/UDP packet + and look for port 520 used by RIP which is then not + treated as an activity packet */ + pport = (u32 *)(skb->data + 2 + (skb->data[2] & 0x0F)*4); + if(( (((*pport)& 0x000000FF) << 8) | + (((*pport) & 0x0000FF00) >> 8) ) != 520) + ppp->last_recv = jiffies; #endif /* CONFIG_PPP_FILTER */ if ((ppp->dev->flags & IFF_UP) == 0 || ppp->npmode[npi] != NPMODE_PASS) { kfree_skb(skb); } else { + /* moved to pppoatm.c */ + /* + struct sk_buff *clones; + clones = alloc_skb(skb->len + 2, GFP_ATOMIC); + if (clones == 0) { + printk(KERN_ERR "PPP rcv frame : no mem for cloned skb\n"); + goto err; + } + else { + skb_reserve(clones, 2); + memcpy(skb_put(clones, skb->len), skb->data, skb->len); + kfree_skb(skb); + skb = clones; + } + */ skb_pull(skb, 2); /* chop off protocol */ skb->dev = ppp->dev; skb->protocol = htons(npindex_to_ethertype[npi]);