diff options
-rw-r--r-- | include/linux/x25.h | 1 | ||||
-rw-r--r-- | net/x25/af_x25.c | 12 | ||||
-rw-r--r-- | net/x25/x25_subr.c | 6 |
3 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/x25.h b/include/linux/x25.h index d035e4e87d07..6450a7f12074 100644 --- a/include/linux/x25.h +++ b/include/linux/x25.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9) | 25 | #define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9) |
26 | #define SIOCX25GDTEFACILITIES (SIOCPROTOPRIVATE + 10) | 26 | #define SIOCX25GDTEFACILITIES (SIOCPROTOPRIVATE + 10) |
27 | #define SIOCX25SDTEFACILITIES (SIOCPROTOPRIVATE + 11) | 27 | #define SIOCX25SDTEFACILITIES (SIOCPROTOPRIVATE + 11) |
28 | #define SIOCX25SCAUSEDIAG (SIOCPROTOPRIVATE + 12) | ||
28 | 29 | ||
29 | /* | 30 | /* |
30 | * Values for {get,set}sockopt. | 31 | * Values for {get,set}sockopt. |
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: |
diff --git a/net/x25/x25_subr.c b/net/x25/x25_subr.c index 511a5986af3e..352b32d216fc 100644 --- a/net/x25/x25_subr.c +++ b/net/x25/x25_subr.c | |||
@@ -225,6 +225,12 @@ void x25_write_internal(struct sock *sk, int frametype) | |||
225 | break; | 225 | break; |
226 | 226 | ||
227 | case X25_CLEAR_REQUEST: | 227 | case X25_CLEAR_REQUEST: |
228 | dptr = skb_put(skb, 3); | ||
229 | *dptr++ = frametype; | ||
230 | *dptr++ = x25->causediag.cause; | ||
231 | *dptr++ = x25->causediag.diagnostic; | ||
232 | break; | ||
233 | |||
228 | case X25_RESET_REQUEST: | 234 | case X25_RESET_REQUEST: |
229 | dptr = skb_put(skb, 3); | 235 | dptr = skb_put(skb, 3); |
230 | *dptr++ = frametype; | 236 | *dptr++ = frametype; |