[PATCH] 2.4.18 IPV6_ADDRFORM

Steve G (linux_4ever@yahoo.com)
Thu, 3 Oct 2002 06:27:27 -0700 (PDT)


The attached patch is created against 2.4.18 (but
2.4.19 seems very close). It adds support for
IPV6_ADDRFORM getsockopt. I sent a patch earlier
deleting IPV6_ADDRFORM from 2.5, but since 2.4 has
IPV6_ADDRFORM defined (and its shipped), it should be
supported rather than deleted.

Cheers,
Steve Grubb

-------

diff -ur linux-2.4.18/net/ipv6/ipv6_sockglue.c
linux-2.4.18a/net/ipv6/ipv6_sockglue.c
--- linux-2.4.18/net/ipv6/ipv6_sockglue.c Thu Sep 20
17:12:56 2001
+++ linux-2.4.18a/net/ipv6/ipv6_sockglue.c Thu Oct 3
09:23:55 2002
@@ -412,6 +412,16 @@
if (get_user(len, optlen))
return -EFAULT;
switch (optname) {
+ case IPV6_ADDRFORM:
+ if (sk->protocol != IPPROTO_UDP &&
+ sk->protocol != IPPROTO_TCP)
+ return -EINVAL;
+
+ if (sk->state != TCP_ESTABLISHED)
+ return -ENOTCONN;
+
+ val = sk->family;
+ break;
case IPV6_PKTOPTIONS:
{
struct msghdr msg;

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/