aboutsummaryrefslogtreecommitdiffstats
path: root/net/x25/af_x25.c
diff options
context:
space:
mode:
authorAndrew Hendry <andrew.hendry@gmail.com>2009-11-19 02:30:41 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-19 02:30:41 -0500
commit386e50cc7d82b3799ea6f53267f04f123ae05afe (patch)
tree6134850a72bbb21e11c2318d84eba0667d7dcf54 /net/x25/af_x25.c
parent0e4817470be8d233fb58b5af7b938185dae94d67 (diff)
X25: Enable setting of cause and diagnostic fields
Adds SIOCX25SCAUSEDIAG, allowing X.25 programs to set the cause and diagnostic fields. Normally used to indicate status upon closing connections. Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/x25/af_x25.c')
-rw-r--r--net/x25/af_x25.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 39ce03e07d18..ac7dba46fa33 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -1471,6 +1471,17 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
1471 break; 1471 break;
1472 } 1472 }
1473 1473
1474 case SIOCX25SCAUSEDIAG: {
1475 struct x25_causediag causediag;
1476 rc = -EFAULT;
1477 if (copy_from_user(&causediag, argp, sizeof(causediag)))
1478 break;
1479 x25->causediag = causediag;
1480 rc = 0;
1481 break;
1482
1483 }
1484
1474 case SIOCX25SCUDMATCHLEN: { 1485 case SIOCX25SCUDMATCHLEN: {
1475 struct x25_subaddr sub_addr; 1486 struct x25_subaddr sub_addr;
1476 rc = -EINVAL; 1487 rc = -EINVAL;
@@ -1639,6 +1650,7 @@ static int compat_x25_ioctl(struct socket *sock, unsigned int cmd,
1639 case SIOCX25GCALLUSERDATA: 1650 case SIOCX25GCALLUSERDATA:
1640 case SIOCX25SCALLUSERDATA: 1651 case SIOCX25SCALLUSERDATA:
1641 case SIOCX25GCAUSEDIAG: 1652 case SIOCX25GCAUSEDIAG:
1653 case SIOCX25SCAUSEDIAG:
1642 case SIOCX25SCUDMATCHLEN: 1654 case SIOCX25SCUDMATCHLEN:
1643 case SIOCX25CALLACCPTAPPRV: 1655 case SIOCX25CALLACCPTAPPRV:
1644 case SIOCX25SENDCALLACCPT: 1656 case SIOCX25SENDCALLACCPT: