andrew hendry | 12 Nov 2009 01:13
Picon

[PATCH] 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 <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)

David Miller | 14 Nov 2009 05:32
Favicon

Re: [PATCH] X25: Enable setting of cause and diagnostic fields

From: andrew hendry <andrew.hendry <at> gmail.com>
Date: Thu, 12 Nov 2009 11:13:27 +1100

> 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>

This change is incomplete.

You need to add handling to compat_x25_ioctl().
--
To unsubscribe from this list: send the line "unsubscribe linux-x25" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

andrew hendry | 19 Nov 2009 00:24
Picon

Re: [PATCH] X25: Enable setting of cause and diagnostic fields

Thanks, will make sure to check 32/64 in the future.

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-16 13:44:41.138892908 +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-16 13:44:41.745816123 +1100
+++ b/net/x25/af_x25.c	2009-11-16 13:49:51.277655328 +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;
(Continue reading)

David Miller | 19 Nov 2009 08:30
Favicon

Re: [PATCH] X25: Enable setting of cause and diagnostic fields

From: andrew hendry <andrew.hendry <at> gmail.com>
Date: Thu, 19 Nov 2009 10:24:01 +1100

> 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>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-x25" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane