aboutsummaryrefslogtreecommitdiffstats
path: root/net/ax25/af_ax25.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ax25/af_ax25.c')
-rw-r--r--net/ax25/af_ax25.c114
1 files changed, 57 insertions, 57 deletions
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index 42233df2b099..9a0b677d1e7f 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -263,9 +263,9 @@ static void ax25_destroy_timer(unsigned long data)
263{ 263{
264 ax25_cb *ax25=(ax25_cb *)data; 264 ax25_cb *ax25=(ax25_cb *)data;
265 struct sock *sk; 265 struct sock *sk;
266 266
267 sk=ax25->sk; 267 sk=ax25->sk;
268 268
269 bh_lock_sock(sk); 269 bh_lock_sock(sk);
270 sock_hold(sk); 270 sock_hold(sk);
271 ax25_destroy_socket(ax25); 271 ax25_destroy_socket(ax25);
@@ -369,57 +369,57 @@ static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg)
369 ax25_disconnect(ax25, ENETRESET); 369 ax25_disconnect(ax25, ENETRESET);
370 break; 370 break;
371 371
372 case AX25_WINDOW: 372 case AX25_WINDOW:
373 if (ax25->modulus == AX25_MODULUS) { 373 if (ax25->modulus == AX25_MODULUS) {
374 if (ax25_ctl.arg < 1 || ax25_ctl.arg > 7) 374 if (ax25_ctl.arg < 1 || ax25_ctl.arg > 7)
375 return -EINVAL; 375 return -EINVAL;
376 } else { 376 } else {
377 if (ax25_ctl.arg < 1 || ax25_ctl.arg > 63) 377 if (ax25_ctl.arg < 1 || ax25_ctl.arg > 63)
378 return -EINVAL; 378 return -EINVAL;
379 } 379 }
380 ax25->window = ax25_ctl.arg; 380 ax25->window = ax25_ctl.arg;
381 break; 381 break;
382 382
383 case AX25_T1: 383 case AX25_T1:
384 if (ax25_ctl.arg < 1) 384 if (ax25_ctl.arg < 1)
385 return -EINVAL;
386 ax25->rtt = (ax25_ctl.arg * HZ) / 2;
387 ax25->t1 = ax25_ctl.arg * HZ;
388 break;
389
390 case AX25_T2:
391 if (ax25_ctl.arg < 1)
392 return -EINVAL;
393 ax25->t2 = ax25_ctl.arg * HZ;
394 break;
395
396 case AX25_N2:
397 if (ax25_ctl.arg < 1 || ax25_ctl.arg > 31)
398 return -EINVAL; 385 return -EINVAL;
399 ax25->n2count = 0; 386 ax25->rtt = (ax25_ctl.arg * HZ) / 2;
400 ax25->n2 = ax25_ctl.arg; 387 ax25->t1 = ax25_ctl.arg * HZ;
401 break; 388 break;
402 389
403 case AX25_T3: 390 case AX25_T2:
404 if (ax25_ctl.arg < 0) 391 if (ax25_ctl.arg < 1)
405 return -EINVAL; 392 return -EINVAL;
406 ax25->t3 = ax25_ctl.arg * HZ; 393 ax25->t2 = ax25_ctl.arg * HZ;
407 break; 394 break;
408 395
409 case AX25_IDLE: 396 case AX25_N2:
410 if (ax25_ctl.arg < 0) 397 if (ax25_ctl.arg < 1 || ax25_ctl.arg > 31)
411 return -EINVAL; 398 return -EINVAL;
412 ax25->idle = ax25_ctl.arg * 60 * HZ; 399 ax25->n2count = 0;
413 break; 400 ax25->n2 = ax25_ctl.arg;
414 401 break;
415 case AX25_PACLEN: 402
416 if (ax25_ctl.arg < 16 || ax25_ctl.arg > 65535) 403 case AX25_T3:
417 return -EINVAL; 404 if (ax25_ctl.arg < 0)
418 ax25->paclen = ax25_ctl.arg; 405 return -EINVAL;
419 break; 406 ax25->t3 = ax25_ctl.arg * HZ;
420 407 break;
421 default: 408
422 return -EINVAL; 409 case AX25_IDLE:
410 if (ax25_ctl.arg < 0)
411 return -EINVAL;
412 ax25->idle = ax25_ctl.arg * 60 * HZ;
413 break;
414
415 case AX25_PACLEN:
416 if (ax25_ctl.arg < 16 || ax25_ctl.arg > 65535)
417 return -EINVAL;
418 ax25->paclen = ax25_ctl.arg;
419 break;
420
421 default:
422 return -EINVAL;
423 } 423 }
424 424
425 return 0; 425 return 0;
@@ -1209,7 +1209,7 @@ static int __must_check ax25_connect(struct socket *sock,
1209 1209
1210 if (sk->sk_type == SOCK_SEQPACKET && 1210 if (sk->sk_type == SOCK_SEQPACKET &&
1211 (ax25t=ax25_find_cb(&ax25->source_addr, &fsa->fsa_ax25.sax25_call, digi, 1211 (ax25t=ax25_find_cb(&ax25->source_addr, &fsa->fsa_ax25.sax25_call, digi,
1212 ax25->ax25_dev->dev))) { 1212 ax25->ax25_dev->dev))) {
1213 kfree(digi); 1213 kfree(digi);
1214 err = -EADDRINUSE; /* Already such a connection */ 1214 err = -EADDRINUSE; /* Already such a connection */
1215 ax25_cb_put(ax25t); 1215 ax25_cb_put(ax25t);
@@ -1456,7 +1456,7 @@ static int ax25_sendmsg(struct kiocb *iocb, struct socket *sock,
1456 err = -EMSGSIZE; 1456 err = -EMSGSIZE;
1457 goto out; 1457 goto out;
1458 } 1458 }
1459 1459
1460 if (usax != NULL) { 1460 if (usax != NULL) {
1461 if (usax->sax25_family != AF_AX25) { 1461 if (usax->sax25_family != AF_AX25) {
1462 err = -EINVAL; 1462 err = -EINVAL;
@@ -1470,8 +1470,8 @@ static int ax25_sendmsg(struct kiocb *iocb, struct socket *sock,
1470 else if (addr_len != sizeof(struct full_sockaddr_ax25)) { 1470 else if (addr_len != sizeof(struct full_sockaddr_ax25)) {
1471 /* support for old structure may go away some time */ 1471 /* support for old structure may go away some time */
1472 if ((addr_len < sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 6) || 1472 if ((addr_len < sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 6) ||
1473 (addr_len > sizeof(struct full_sockaddr_ax25))) { 1473 (addr_len > sizeof(struct full_sockaddr_ax25))) {
1474 err = -EINVAL; 1474 err = -EINVAL;
1475 goto out; 1475 goto out;
1476 } 1476 }
1477 1477
@@ -1624,7 +1624,7 @@ static int ax25_recvmsg(struct kiocb *iocb, struct socket *sock,
1624 1624
1625 /* Now we can treat all alike */ 1625 /* Now we can treat all alike */
1626 skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT, 1626 skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
1627 flags & MSG_DONTWAIT, &err); 1627 flags & MSG_DONTWAIT, &err);
1628 if (skb == NULL) 1628 if (skb == NULL)
1629 goto out; 1629 goto out;
1630 1630
@@ -1869,7 +1869,7 @@ static void *ax25_info_next(struct seq_file *seq, void *v, loff_t *pos)
1869 return hlist_entry( ((struct ax25_cb *)v)->ax25_node.next, 1869 return hlist_entry( ((struct ax25_cb *)v)->ax25_node.next,
1870 struct ax25_cb, ax25_node); 1870 struct ax25_cb, ax25_node);
1871} 1871}
1872 1872
1873static void ax25_info_stop(struct seq_file *seq, void *v) 1873static void ax25_info_stop(struct seq_file *seq, void *v)
1874{ 1874{
1875 spin_unlock_bh(&ax25_list_lock); 1875 spin_unlock_bh(&ax25_list_lock);