fix VJ compression
This commit is contained in:
parent
45daefbcc7
commit
6cb6a3e3f9
|
@ -1003,8 +1003,7 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
|
|||
slot = lp->ppp_slot;
|
||||
if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
|
||||
printk(KERN_ERR "isdn_ppp_push_higher: lp->ppp_slot %d\n", lp->ppp_slot);
|
||||
kfree_skb(skb);
|
||||
return;
|
||||
goto drop_packet;
|
||||
}
|
||||
is = ippp_table[slot];
|
||||
|
||||
|
@ -1012,14 +1011,11 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
|
|||
slot = ((isdn_net_local *) (lp->master->priv))->ppp_slot;
|
||||
if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
|
||||
printk(KERN_ERR "isdn_ppp_push_higher: master->ppp_slot %d\n", lp->ppp_slot);
|
||||
kfree_skb(skb);
|
||||
return;
|
||||
goto drop_packet;
|
||||
}
|
||||
}
|
||||
mis = ippp_table[slot];
|
||||
if (mis != is) {
|
||||
printk(KERN_WARNING __FUNCTION__ ": BUG: is != mis %d %d %p %p\n", slot, lp->ppp_slot, mis, is);
|
||||
}
|
||||
|
||||
if (is->debug & 0x10) {
|
||||
printk(KERN_DEBUG "push, skb %d %04x\n", (int) skb->len, proto);
|
||||
isdn_ppp_frame_log("rpush", skb->data, skb->len, 32,is->unit,lp->ppp_slot);
|
||||
|
@ -1033,15 +1029,11 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
|
|||
case PPP_IPX: /* untested */
|
||||
if (is->debug & 0x20)
|
||||
printk(KERN_DEBUG "isdn_ppp: IPX\n");
|
||||
skb->dev = dev;
|
||||
skb->mac.raw = skb->data;
|
||||
skb->protocol = htons(ETH_P_IPX);
|
||||
break;
|
||||
case PPP_IP:
|
||||
if (is->debug & 0x20)
|
||||
printk(KERN_DEBUG "isdn_ppp: IP\n");
|
||||
skb->dev = dev;
|
||||
skb->mac.raw = skb->data;
|
||||
skb->protocol = htons(ETH_P_IP);
|
||||
break;
|
||||
#ifdef CONFIG_ISDN_PPP_VJ
|
||||
|
@ -1050,10 +1042,10 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
|
|||
printk(KERN_DEBUG "isdn_ppp: VJC_UNCOMP\n");
|
||||
if (slhc_remember(ippp_table[net_dev->local->ppp_slot]->slcomp, skb->data, skb->len) <= 0) {
|
||||
printk(KERN_WARNING "isdn_ppp: received illegal VJC_UNCOMP frame!\n");
|
||||
net_dev->local->stats.rx_dropped++;
|
||||
kfree_skb(skb);
|
||||
return;
|
||||
goto drop_packet;
|
||||
}
|
||||
skb->protocol = htons(ETH_P_IP);
|
||||
break;
|
||||
case PPP_VJC_COMP:
|
||||
if (is->debug & 0x20)
|
||||
printk(KERN_DEBUG "isdn_ppp: VJC_COMP\n");
|
||||
|
@ -1064,22 +1056,17 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
|
|||
|
||||
if (!skb) {
|
||||
printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", dev->name);
|
||||
net_dev->local->stats.rx_dropped++;
|
||||
kfree_skb(skb_old);
|
||||
return;
|
||||
skb = skb_old;
|
||||
goto drop_packet;
|
||||
}
|
||||
skb->dev = dev;
|
||||
skb_put(skb, skb_old->len + 128);
|
||||
memcpy(skb->data, skb_old->data, skb_old->len);
|
||||
skb->mac.raw = skb->data;
|
||||
pkt_len = slhc_uncompress(ippp_table[net_dev->local->ppp_slot]->slcomp,
|
||||
skb->data, skb_old->len);
|
||||
kfree_skb(skb_old);
|
||||
if (pkt_len < 0) {
|
||||
kfree_skb(skb);
|
||||
lp->stats.rx_dropped++;
|
||||
return;
|
||||
}
|
||||
if (pkt_len < 0)
|
||||
goto drop_packet;
|
||||
|
||||
skb_trim(skb, pkt_len);
|
||||
skb->protocol = htons(ETH_P_IP);
|
||||
}
|
||||
|
@ -1096,7 +1083,7 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
|
|||
/* fall through */
|
||||
default:
|
||||
isdn_ppp_fill_rq(skb->data, skb->len, proto, lp->ppp_slot); /* push data to pppd device */
|
||||
dev_kfree_skb(skb);
|
||||
kfree_skb(skb);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1105,10 +1092,17 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
|
|||
#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
|
||||
lp->dw_abc_bchan_errcnt = 0;
|
||||
#endif
|
||||
netif_rx(skb);
|
||||
/* net_dev->local->stats.rx_packets++; *//* done in isdn_net.c */
|
||||
|
||||
return;
|
||||
skb->dev = dev;
|
||||
skb->mac.raw = skb->data;
|
||||
netif_rx(skb);
|
||||
/* net_dev->local->stats.rx_packets++; done in isdn_net.c */
|
||||
return;
|
||||
|
||||
drop_packet:
|
||||
net_dev->local->stats.rx_dropped++;
|
||||
kfree_skb(skb);
|
||||
netif_rx(skb);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue