aboutsummaryrefslogtreecommitdiffstats
path: root/net/x25/af_x25.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/x25/af_x25.c')
-rw-r--r--net/x25/af_x25.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index b37d894358ec..e62ba41b05c5 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * This is ALPHA test software. This code may break your machine, 4 * This is ALPHA test software. This code may break your machine,
5 * randomly fail to work with new releases, misbehave and/or generally 5 * randomly fail to work with new releases, misbehave and/or generally
6 * screw up. It might even work. 6 * screw up. It might even work.
7 * 7 *
8 * This code REQUIRES 2.1.15 or higher 8 * This code REQUIRES 2.1.15 or higher
9 * 9 *
@@ -18,11 +18,11 @@
18 * X.25 002 Jonathan Naylor Centralised disconnect handling. 18 * X.25 002 Jonathan Naylor Centralised disconnect handling.
19 * New timer architecture. 19 * New timer architecture.
20 * 2000-03-11 Henner Eisen MSG_EOR handling more POSIX compliant. 20 * 2000-03-11 Henner Eisen MSG_EOR handling more POSIX compliant.
21 * 2000-03-22 Daniela Squassoni Allowed disabling/enabling of 21 * 2000-03-22 Daniela Squassoni Allowed disabling/enabling of
22 * facilities negotiation and increased 22 * facilities negotiation and increased
23 * the throughput upper limit. 23 * the throughput upper limit.
24 * 2000-08-27 Arnaldo C. Melo s/suser/capable/ + micro cleanups 24 * 2000-08-27 Arnaldo C. Melo s/suser/capable/ + micro cleanups
25 * 2000-09-04 Henner Eisen Set sock->state in x25_accept(). 25 * 2000-09-04 Henner Eisen Set sock->state in x25_accept().
26 * Fixed x25_output() related skb leakage. 26 * Fixed x25_output() related skb leakage.
27 * 2000-10-02 Henner Eisen Made x25_kick() single threaded per socket. 27 * 2000-10-02 Henner Eisen Made x25_kick() single threaded per socket.
28 * 2000-10-27 Henner Eisen MSG_DONTWAIT for fragment allocation. 28 * 2000-10-27 Henner Eisen MSG_DONTWAIT for fragment allocation.
@@ -256,8 +256,8 @@ static struct sock *x25_find_listener(struct x25_address *addr,
256 * call user data vs this sockets call user data 256 * call user data vs this sockets call user data
257 */ 257 */
258 if(skb->len > 0 && x25_sk(s)->cudmatchlength > 0) { 258 if(skb->len > 0 && x25_sk(s)->cudmatchlength > 0) {
259 if((memcmp(x25_sk(s)->calluserdata.cuddata, 259 if((memcmp(x25_sk(s)->calluserdata.cuddata,
260 skb->data, 260 skb->data,
261 x25_sk(s)->cudmatchlength)) == 0) { 261 x25_sk(s)->cudmatchlength)) == 0) {
262 sock_hold(s); 262 sock_hold(s);
263 goto found; 263 goto found;
@@ -421,7 +421,7 @@ static int x25_getsockopt(struct socket *sock, int level, int optname,
421{ 421{
422 struct sock *sk = sock->sk; 422 struct sock *sk = sock->sk;
423 int val, len, rc = -ENOPROTOOPT; 423 int val, len, rc = -ENOPROTOOPT;
424 424
425 if (level != SOL_X25 || optname != X25_QBITINCL) 425 if (level != SOL_X25 || optname != X25_QBITINCL)
426 goto out; 426 goto out;
427 427
@@ -434,7 +434,7 @@ static int x25_getsockopt(struct socket *sock, int level, int optname,
434 rc = -EINVAL; 434 rc = -EINVAL;
435 if (len < 0) 435 if (len < 0)
436 goto out; 436 goto out;
437 437
438 rc = -EFAULT; 438 rc = -EFAULT;
439 if (put_user(len, optlen)) 439 if (put_user(len, optlen))
440 goto out; 440 goto out;
@@ -523,12 +523,12 @@ static int x25_create(struct socket *sock, int protocol)
523 x25->facilities.pacsize_out = X25_DEFAULT_PACKET_SIZE; 523 x25->facilities.pacsize_out = X25_DEFAULT_PACKET_SIZE;
524 x25->facilities.throughput = X25_DEFAULT_THROUGHPUT; 524 x25->facilities.throughput = X25_DEFAULT_THROUGHPUT;
525 x25->facilities.reverse = X25_DEFAULT_REVERSE; 525 x25->facilities.reverse = X25_DEFAULT_REVERSE;
526 x25->dte_facilities.calling_len = 0; 526 x25->dte_facilities.calling_len = 0;
527 x25->dte_facilities.called_len = 0; 527 x25->dte_facilities.called_len = 0;
528 memset(x25->dte_facilities.called_ae, '\0', 528 memset(x25->dte_facilities.called_ae, '\0',
529 sizeof(x25->dte_facilities.called_ae)); 529 sizeof(x25->dte_facilities.called_ae));
530 memset(x25->dte_facilities.calling_ae, '\0', 530 memset(x25->dte_facilities.calling_ae, '\0',
531 sizeof(x25->dte_facilities.calling_ae)); 531 sizeof(x25->dte_facilities.calling_ae));
532 532
533 rc = 0; 533 rc = 0;
534out: 534out:
@@ -608,7 +608,7 @@ static int x25_release(struct socket *sock)
608 break; 608 break;
609 } 609 }
610 610
611 sock->sk = NULL; 611 sock->sk = NULL;
612 sk->sk_socket = NULL; /* Not used, but we should do this */ 612 sk->sk_socket = NULL; /* Not used, but we should do this */
613out: 613out:
614 return 0; 614 return 0;
@@ -635,7 +635,7 @@ static int x25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
635static int x25_wait_for_connection_establishment(struct sock *sk) 635static int x25_wait_for_connection_establishment(struct sock *sk)
636{ 636{
637 DECLARE_WAITQUEUE(wait, current); 637 DECLARE_WAITQUEUE(wait, current);
638 int rc; 638 int rc;
639 639
640 add_wait_queue_exclusive(sk->sk_sleep, &wait); 640 add_wait_queue_exclusive(sk->sk_sleep, &wait);
641 for (;;) { 641 for (;;) {
@@ -686,7 +686,7 @@ static int x25_connect(struct socket *sock, struct sockaddr *uaddr,
686 if (sk->sk_state == TCP_ESTABLISHED) 686 if (sk->sk_state == TCP_ESTABLISHED)
687 goto out; 687 goto out;
688 688
689 sk->sk_state = TCP_CLOSE; 689 sk->sk_state = TCP_CLOSE;
690 sock->state = SS_UNCONNECTED; 690 sock->state = SS_UNCONNECTED;
691 691
692 rc = -EINVAL; 692 rc = -EINVAL;
@@ -778,7 +778,7 @@ static int x25_wait_for_data(struct sock *sk, long timeout)
778 remove_wait_queue(sk->sk_sleep, &wait); 778 remove_wait_queue(sk->sk_sleep, &wait);
779 return rc; 779 return rc;
780} 780}
781 781
782static int x25_accept(struct socket *sock, struct socket *newsock, int flags) 782static int x25_accept(struct socket *sock, struct socket *newsock, int flags)
783{ 783{
784 struct sock *sk = sock->sk; 784 struct sock *sk = sock->sk;
@@ -837,7 +837,7 @@ static int x25_getname(struct socket *sock, struct sockaddr *uaddr,
837 837
838 return 0; 838 return 0;
839} 839}
840 840
841int x25_rx_call_request(struct sk_buff *skb, struct x25_neigh *nb, 841int x25_rx_call_request(struct sk_buff *skb, struct x25_neigh *nb,
842 unsigned int lci) 842 unsigned int lci)
843{ 843{
@@ -1120,7 +1120,7 @@ static int x25_sendmsg(struct kiocb *iocb, struct socket *sock,
1120 if (msg->msg_flags & MSG_OOB) 1120 if (msg->msg_flags & MSG_OOB)
1121 skb_queue_tail(&x25->interrupt_out_queue, skb); 1121 skb_queue_tail(&x25->interrupt_out_queue, skb);
1122 else { 1122 else {
1123 len = x25_output(sk, skb); 1123 len = x25_output(sk, skb);
1124 if (len < 0) 1124 if (len < 0)
1125 kfree_skb(skb); 1125 kfree_skb(skb);
1126 else if (x25->qbitincl) 1126 else if (x25->qbitincl)
@@ -1219,7 +1219,7 @@ static int x25_recvmsg(struct kiocb *iocb, struct socket *sock,
1219 msg->msg_flags |= MSG_TRUNC; 1219 msg->msg_flags |= MSG_TRUNC;
1220 } 1220 }
1221 1221
1222 /* Currently, each datagram always contains a complete record */ 1222 /* Currently, each datagram always contains a complete record */
1223 msg->msg_flags |= MSG_EOR; 1223 msg->msg_flags |= MSG_EOR;
1224 1224
1225 rc = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); 1225 rc = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
@@ -1277,8 +1277,8 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
1277 case SIOCGSTAMP: 1277 case SIOCGSTAMP:
1278 rc = -EINVAL; 1278 rc = -EINVAL;
1279 if (sk) 1279 if (sk)
1280 rc = sock_get_timestamp(sk, 1280 rc = sock_get_timestamp(sk,
1281 (struct timeval __user *)argp); 1281 (struct timeval __user *)argp);
1282 break; 1282 break;
1283 case SIOCGIFADDR: 1283 case SIOCGIFADDR:
1284 case SIOCSIFADDR: 1284 case SIOCSIFADDR:
@@ -1346,17 +1346,17 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
1346 } 1346 }
1347 1347
1348 case SIOCX25GDTEFACILITIES: { 1348 case SIOCX25GDTEFACILITIES: {
1349 rc = copy_to_user(argp, &x25->dte_facilities, 1349 rc = copy_to_user(argp, &x25->dte_facilities,
1350 sizeof(x25->dte_facilities)); 1350 sizeof(x25->dte_facilities));
1351 if (rc) 1351 if (rc)
1352 rc = -EFAULT; 1352 rc = -EFAULT;
1353 break; 1353 break;
1354 } 1354 }
1355 1355
1356 case SIOCX25SDTEFACILITIES: { 1356 case SIOCX25SDTEFACILITIES: {
1357 struct x25_dte_facilities dtefacs; 1357 struct x25_dte_facilities dtefacs;
1358 rc = -EFAULT; 1358 rc = -EFAULT;
1359 if (copy_from_user(&dtefacs, argp, sizeof(dtefacs))) 1359 if (copy_from_user(&dtefacs, argp, sizeof(dtefacs)))
1360 break; 1360 break;
1361 rc = -EINVAL; 1361 rc = -EINVAL;
1362 if (sk->sk_state != TCP_LISTEN && 1362 if (sk->sk_state != TCP_LISTEN &&
@@ -1414,7 +1414,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
1414 if (copy_from_user(&sub_addr, argp, 1414 if (copy_from_user(&sub_addr, argp,
1415 sizeof(sub_addr))) 1415 sizeof(sub_addr)))
1416 break; 1416 break;
1417 rc = -EINVAL; 1417 rc = -EINVAL;
1418 if(sub_addr.cudmatchlength > X25_MAX_CUD_LEN) 1418 if(sub_addr.cudmatchlength > X25_MAX_CUD_LEN)
1419 break; 1419 break;
1420 x25->cudmatchlength = sub_addr.cudmatchlength; 1420 x25->cudmatchlength = sub_addr.cudmatchlength;
@@ -1443,7 +1443,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
1443 break; 1443 break;
1444 } 1444 }
1445 1445
1446 default: 1446 default:
1447 rc = -ENOIOCTLCMD; 1447 rc = -ENOIOCTLCMD;
1448 break; 1448 break;
1449 } 1449 }