isdn_net_hangup(&p->dev);
}
for (i = 0; i < NUM_RCV_BUFFS; i++) {
- if (is->rq[i].buf) {
- kfree(is->rq[i].buf);
- is->rq[i].buf = NULL;
- }
+ kfree(is->rq[i].buf);
+ is->rq[i].buf = NULL;
}
is->first = is->rq + NUM_RCV_BUFFS - 1; /* receive queue */
is->last = is->rq;
is->slcomp = NULL;
#endif
#ifdef CONFIG_IPPP_FILTER
- if (is->pass_filter) {
- kfree(is->pass_filter);
- is->pass_filter = NULL;
- }
- if (is->active_filter) {
- kfree(is->active_filter);
- is->active_filter = NULL;
- }
+ kfree(is->pass_filter);
+ is->pass_filter = NULL;
+ kfree(is->active_filter);
+ is->active_filter = NULL;
#endif
/* TODO: if this was the previous master: link the stuff to the new master */
{
struct ippp_struct *is;
struct ippp_buf_queue *b;
- int r;
u_long flags;
u_char *save_buf;
if (!(is->state & IPPP_OPEN))
return 0;
- if ((r = verify_area(VERIFY_WRITE, buf, count)))
- return r;
+ if (!access_ok(VERIFY_WRITE, buf, count))
+ return -EFAULT;
spin_lock_irqsave(&is->buflock, flags);
b = is->first->next;
kfree(ippp_table[i]);
#ifdef CONFIG_ISDN_MPP
- if (isdn_ppp_bundle_arr)
- kfree(isdn_ppp_bundle_arr);
+ kfree(isdn_ppp_bundle_arr);
#endif /* CONFIG_ISDN_MPP */
}
BUG(); // we're called with the master device always
slot = lp->ppp_slot;
- if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
+ if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
printk(KERN_ERR "isdn_ppp_receive: lp->ppp_slot(%d)\n",
lp->ppp_slot);
kfree_skb(skb);
int slot;
slot = lp->ppp_slot;
- if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
+ if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
printk(KERN_ERR "isdn_ppp_push_higher: lp->ppp_slot(%d)\n",
lp->ppp_slot);
goto drop_packet;
{
u_int16_t *p = (u_int16_t *) skb->data;
- *p = 0; /* indicate inbound in DLT_LINUX_SLL */
+ *p = 0; /* indicate inbound */
}
if (is->pass_filter
nd = mlp->netdev; /* get master lp */
slot = mlp->ppp_slot;
- if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
+ if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
printk(KERN_ERR "isdn_ppp_xmit: lp->ppp_slot(%d)\n",
mlp->ppp_slot);
kfree_skb(skb);
/* check if we should pass this packet
* the filter instructions are constructed assuming
* a four-byte PPP header on each packet */
- skb_push(skb, 4);
+ *skb_push(skb, 4) = 1; /* indicate outbound */
{
u_int16_t *p = (u_int16_t *) skb->data;
- *p++ = htons(4); /* indicate outbound in DLT_LINUX_SLL */
+ p++;
*p = htons(proto);
}
* temporarily remove part of the fake header stuck on
* earlier.
*/
- skb_pull(skb, IPPP_MAX_HEADER - 4);
+ *skb_pull(skb, IPPP_MAX_HEADER - 4) = 1; /* indicate outbound */
{
u_int16_t *p = (u_int16_t *) skb->data;
- *p++ = htons(4); /* indicate outbound in DLT_LINUX_SLL */
+ p++;
*p = htons(proto);
}
lp->next = lp->last = lp; /* nobody else in a queue */
lp->netdev->pb->frags = NULL;
lp->netdev->pb->frames = 0;
- lp->netdev->pb->seq = LONG_MAX;
+ lp->netdev->pb->seq = UINT_MAX;
}
lp->netdev->pb->ref_ct++;
struct sk_buff * skb;
unsigned int tot_len;
- if (lp->ppp_slot < 0 || lp->ppp_slot > ISDN_MAX_CHANNELS) {
+ if (lp->ppp_slot < 0 || lp->ppp_slot >= ISDN_MAX_CHANNELS) {
printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
__FUNCTION__, lp->ppp_slot);
return;
struct ppp_stats __user *res = ifr->ifr_data;
struct ppp_stats t;
isdn_net_local *lp = (isdn_net_local *) dev->priv;
- int err;
- err = verify_area(VERIFY_WRITE, res, sizeof(struct ppp_stats));
-
- if (err)
- return err;
+ if (!access_ok(VERIFY_WRITE, res, sizeof(struct ppp_stats)))
+ return -EFAULT;
/* build a temporary stat struct and copy it to user space */
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;
if(!skb || skb->len < 3)
return;
- if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
+ if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
__FUNCTION__, slot);
return;