]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/isdn/i4l/isdn_ppp.c
[SK_BUFF]: Introduce skb_copy_from_linear_data{_offset}
[net-next-2.6.git] / drivers / isdn / i4l / isdn_ppp.c
index 43811795b46bfb31bdd947e7998e73a487588234..387392cb3d6804fabbf28b713f2a4ac009e81b97 100644 (file)
@@ -717,7 +717,7 @@ isdn_ppp_fill_rq(unsigned char *buf, int len, int proto, int slot)
                printk(KERN_DEBUG "ippp: device not activated.\n");
                return 0;
        }
-       nbuf = (unsigned char *) kmalloc(len + 4, GFP_ATOMIC);
+       nbuf = kmalloc(len + 4, GFP_ATOMIC);
        if (!nbuf) {
                printk(KERN_WARNING "ippp: Can't alloc buf\n");
                return 0;
@@ -1100,7 +1100,8 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
                                        goto drop_packet;
                                }
                                skb_put(skb, skb_old->len + 128);
-                               memcpy(skb->data, skb_old->data, skb_old->len);
+                               skb_copy_from_linear_data(skb_old, skb->data,
+                                                         skb_old->len);
                                if (net_dev->local->ppp_slot < 0) {
                                        printk(KERN_ERR "%s: net_dev->local->ppp_slot(%d) out of range\n",
                                                __FUNCTION__, net_dev->local->ppp_slot);
@@ -1167,7 +1168,7 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
                mlp->huptimer = 0;
 #endif /* CONFIG_IPPP_FILTER */
        skb->dev = dev;
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        netif_rx(skb);
        /* net_dev->local->stats.rx_packets++; done in isdn_net.c */
        return;
@@ -1680,7 +1681,7 @@ static void isdn_ppp_mp_receive(isdn_net_dev * net_dev, isdn_net_local * lp,
         * - we hit a gap in the sequence, so no reassembly/processing is 
         *   possible ('start' would be set to NULL)
         *
-        * algorightm for this code is derived from code in the book
+        * algorithm for this code is derived from code in the book
         * 'PPP Design And Debugging' by James Carlson (Addison-Wesley)
         */
        while (start != NULL || newfrag != NULL) {
@@ -1902,7 +1903,9 @@ void isdn_ppp_mp_reassembly( isdn_net_dev * net_dev, isdn_net_local * lp,
                while( from != to ) {
                        unsigned int len = from->len - MP_HEADER_LEN;
 
-                       memcpy(skb_put(skb,len), from->data+MP_HEADER_LEN, len);
+                       skb_copy_from_linear_data_offset(from, MP_HEADER_LEN,
+                                                        skb_put(skb,len),
+                                                        len);
                        frag = from->next;
                        isdn_ppp_mp_free_skb(mp, from);
                        from = frag; 
@@ -2339,6 +2342,7 @@ static struct ippp_ccp_reset_state *isdn_ppp_ccp_reset_alloc_state(struct ippp_s
                rs->state = CCPResetIdle;
                rs->is = is;
                rs->id = id;
+               init_timer(&rs->timer);
                rs->timer.data = (unsigned long)rs;
                rs->timer.function = isdn_ppp_ccp_timer_callback;
                is->reset->rs[id] = rs;