12 Nov 2009 01:13
[PATCH] X25: Enable setting of cause and diagnostic fields
andrew hendry <andrew.hendry <at> gmail.com>
2009-11-12 00:13:27 GMT
2009-11-12 00:13:27 GMT
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 <at> gmail.com>
diff -uprN -X a/Documentation/dontdiff a/include/linux/x25.h
b/include/linux/x25.h
--- a/include/linux/x25.h 2009-11-11 14:03:26.659663301 +1100
+++ b/include/linux/x25.h 2009-11-11 16:05:06.625958557 +1100
<at> <at> -25,6 +25,7 <at> <at>
#define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9)
#define SIOCX25GDTEFACILITIES (SIOCPROTOPRIVATE + 10)
#define SIOCX25SDTEFACILITIES (SIOCPROTOPRIVATE + 11)
+#define SIOCX25SCAUSEDIAG (SIOCPROTOPRIVATE + 12)
/*
* Values for {get,set}sockopt.
diff -uprN -X a/Documentation/dontdiff a/net/x25/af_x25.c b/net/x25/af_x25.c
--- a/net/x25/af_x25.c 2009-11-11 14:02:44.027061001 +1100
+++ b/net/x25/af_x25.c 2009-11-11 16:22:51.374077963 +1100
<at> <at> -1430,6 +1430,17 <at> <at> static int x25_ioctl(struct socket *sock
break;
}
+ case SIOCX25SCAUSEDIAG: {
+ struct x25_causediag causediag;
+ rc = -EFAULT;
+ if (copy_from_user(&causediag, argp, sizeof(causediag)))
+ break;
(Continue reading)
RSS Feed