Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 166354
b: refs/heads/master
c: c0181d4
h: refs/heads/master
v: v3
  • Loading branch information
Jarek Poplawski authored and David S. Miller committed Sep 25, 2009
1 parent f67a66d commit 9c60256
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a91eba5b9db4c09f53c8f23327915c7c75d3235f
refs/heads/master: c0181d420cc1a506ca4418ce90e2ad89831eee2c
27 changes: 17 additions & 10 deletions trunk/net/ax25/af_ax25.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg)
ax25_dev *ax25_dev;
ax25_cb *ax25;
unsigned int k;
int ret = 0;

if (copy_from_user(&ax25_ctl, arg, sizeof(ax25_ctl)))
return -EFAULT;
Expand Down Expand Up @@ -388,57 +389,63 @@ static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg)
case AX25_WINDOW:
if (ax25->modulus == AX25_MODULUS) {
if (ax25_ctl.arg < 1 || ax25_ctl.arg > 7)
return -EINVAL;
goto einval_put;
} else {
if (ax25_ctl.arg < 1 || ax25_ctl.arg > 63)
return -EINVAL;
goto einval_put;
}
ax25->window = ax25_ctl.arg;
break;

case AX25_T1:
if (ax25_ctl.arg < 1)
return -EINVAL;
goto einval_put;
ax25->rtt = (ax25_ctl.arg * HZ) / 2;
ax25->t1 = ax25_ctl.arg * HZ;
break;

case AX25_T2:
if (ax25_ctl.arg < 1)
return -EINVAL;
goto einval_put;
ax25->t2 = ax25_ctl.arg * HZ;
break;

case AX25_N2:
if (ax25_ctl.arg < 1 || ax25_ctl.arg > 31)
return -EINVAL;
goto einval_put;
ax25->n2count = 0;
ax25->n2 = ax25_ctl.arg;
break;

case AX25_T3:
if (ax25_ctl.arg < 0)
return -EINVAL;
goto einval_put;
ax25->t3 = ax25_ctl.arg * HZ;
break;

case AX25_IDLE:
if (ax25_ctl.arg < 0)
return -EINVAL;
goto einval_put;
ax25->idle = ax25_ctl.arg * 60 * HZ;
break;

case AX25_PACLEN:
if (ax25_ctl.arg < 16 || ax25_ctl.arg > 65535)
return -EINVAL;
goto einval_put;
ax25->paclen = ax25_ctl.arg;
break;

default:
return -EINVAL;
goto einval_put;
}

return 0;
out_put:
ax25_cb_put(ax25);
return ret;

einval_put:
ret = -EINVAL;
goto out_put;
}

static void ax25_fillin_cb_from_dev(ax25_cb *ax25, ax25_dev *ax25_dev)
Expand Down

0 comments on commit 9c60256

Please sign in to comment.