linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] 2.5.40 - remove IPV6_ADDRFORM
  2002-10-03 12:45 [PATCH] 2.5.40 - remove IPV6_ADDRFORM Steve G
@ 2002-10-03 12:43 ` David S. Miller
  2002-10-03 13:36   ` Steve G
  2002-10-03 16:04   ` kuznet
  0 siblings, 2 replies; 8+ messages in thread
From: David S. Miller @ 2002-10-03 12:43 UTC (permalink / raw)
  To: linux_4ever; +Cc: linux-kernel

   From: Steve G <linux_4ever@yahoo.com>
   Date: Thu, 3 Oct 2002 05:45:09 -0700 (PDT)

   The following patch removes the deprecated
   IPV6_ADDRFORM socket option from 2.5.40. I checked
   OpenBSD & FreeBSD and both do not support this option,
   so I think its safe to remove.

Are we absolutely sure no applications use this?

Also, if you are going to fix the indentation in the header
file, please do so in a seperate patch.  Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] 2.5.40 - remove IPV6_ADDRFORM
@ 2002-10-03 12:45 Steve G
  2002-10-03 12:43 ` David S. Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Steve G @ 2002-10-03 12:45 UTC (permalink / raw)
  To: linux-kernel, davem

Hello,

The following patch removes the deprecated
IPV6_ADDRFORM socket option from 2.5.40. I checked
OpenBSD & FreeBSD and both do not support this option,
so I think its safe to remove.

Cheers,
Steve Grubb

-------

diff -ur linux-2.5.40/include/linux/in6.h
linux-2.5.40a/include/linux/in6.h
--- linux-2.5.40/include/linux/in6.h	Tue Oct  1
03:07:07 2002
+++ linux-2.5.40a/include/linux/in6.h	Thu Oct  3
07:27:56 2002
@@ -134,17 +134,16 @@
  *	IPV6 socket options
  */
 
-#define IPV6_ADDRFORM		1
-#define IPV6_PKTINFO		2
-#define IPV6_HOPOPTS		3
-#define IPV6_DSTOPTS		4
-#define IPV6_RTHDR		5
-#define IPV6_PKTOPTIONS		6
-#define IPV6_CHECKSUM		7
-#define IPV6_HOPLIMIT		8
-#define IPV6_NEXTHOP		9
-#define IPV6_AUTHHDR		10
-#define IPV6_FLOWINFO		11
+#define IPV6_PKTINFO		1
+#define IPV6_HOPOPTS		2
+#define IPV6_DSTOPTS		3
+#define IPV6_RTHDR		4
+#define IPV6_PKTOPTIONS		5
+#define IPV6_CHECKSUM		6
+#define IPV6_HOPLIMIT		7
+#define IPV6_NEXTHOP		8
+#define IPV6_AUTHHDR		9
+#define IPV6_FLOWINFO		10
 
 #define IPV6_UNICAST_HOPS	16
 #define IPV6_MULTICAST_IF	17
diff -ur linux-2.5.40/net/ipv6/ipv6_sockglue.c
linux-2.5.40a/net/ipv6/ipv6_sockglue.c
--- linux-2.5.40/net/ipv6/ipv6_sockglue.c	Tue Oct  1
03:06:16 2002
+++ linux-2.5.40a/net/ipv6/ipv6_sockglue.c	Thu Oct  3
07:23:59 2002
@@ -143,66 +143,6 @@
 
 	switch (optname) {
 
-	case IPV6_ADDRFORM:
-		if (val == PF_INET) {
-			struct ipv6_txoptions *opt;
-			struct sk_buff *pktopt;
-
-			if (sk->protocol != IPPROTO_UDP &&
-			    sk->protocol != IPPROTO_TCP)
-				break;
-
-			if (sk->state != TCP_ESTABLISHED) {
-				retv = -ENOTCONN;
-				break;
-			}
-
-			if (!(ipv6_addr_type(&np->daddr) &
IPV6_ADDR_MAPPED)) {
-				retv = -EADDRNOTAVAIL;
-				break;
-			}
-
-			fl6_free_socklist(sk);
-			ipv6_sock_mc_close(sk);
-
-			if (sk->protocol == IPPROTO_TCP) {
-				struct tcp_opt *tp = tcp_sk(sk);
-
-				local_bh_disable();
-				sock_prot_dec_use(sk->prot);
-				sock_prot_inc_use(&tcp_prot);
-				local_bh_enable();
-				sk->prot = &tcp_prot;
-				tp->af_specific = &ipv4_specific;
-				sk->socket->ops = &inet_stream_ops;
-				sk->family = PF_INET;
-				tcp_sync_mss(sk, tp->pmtu_cookie);
-			} else {
-				local_bh_disable();
-				sock_prot_dec_use(sk->prot);
-				sock_prot_inc_use(&udp_prot);
-				local_bh_enable();
-				sk->prot = &udp_prot;
-				sk->socket->ops = &inet_dgram_ops;
-				sk->family = PF_INET;
-			}
-			opt = xchg(&np->opt, NULL);
-			if (opt)
-				sock_kfree_s(sk, opt, opt->tot_len);
-			pktopt = xchg(&np->pktoptions, NULL);
-			if (pktopt)
-				kfree_skb(pktopt);
-
-			sk->destruct = inet_sock_destruct;
-#ifdef INET_REFCNT_DEBUG
-			atomic_dec(&inet6_sock_nr);
-#endif
-			MOD_DEC_USE_COUNT;
-			retv = 0;
-			break;
-		}
-		goto e_inval;
-
 	case IPV6_PKTINFO:
 		np->rxopt.bits.rxinfo = valbool;
 		retv = 0;


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] 2.5.40 - remove IPV6_ADDRFORM
  2002-10-03 13:36   ` Steve G
@ 2002-10-03 13:32     ` David S. Miller
  2002-10-03 13:57       ` Steve G
  0 siblings, 1 reply; 8+ messages in thread
From: David S. Miller @ 2002-10-03 13:32 UTC (permalink / raw)
  To: linux_4ever; +Cc: linux-kernel

   From: Steve G <linux_4ever@yahoo.com>
   Date: Thu, 3 Oct 2002 06:36:34 -0700 (PDT)

   >Also, if you are going to fix the indentation in 
   >the header file, please do so in a seperate patch.
   
   Hmmm, I only wanted to renumber the options since #1
   was removed. Sorry if it changed the alignment.

Don't do that, then every one of those ipv6 options you change which
are being used by userspace breaks.  What made you think such a change
would be legal?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] 2.5.40 - remove IPV6_ADDRFORM
  2002-10-03 12:43 ` David S. Miller
@ 2002-10-03 13:36   ` Steve G
  2002-10-03 13:32     ` David S. Miller
  2002-10-03 16:04   ` kuznet
  1 sibling, 1 reply; 8+ messages in thread
From: Steve G @ 2002-10-03 13:36 UTC (permalink / raw)
  To: David S. Miller; +Cc: linux-kernel

>Are we absolutely sure no applications use this?

Xinetd uses it, which is what kicked off the original
discussion 2 days ago. Inetd applications are probably
the only applications that need this so they can
downgrade a socket for an old app. If its deprecated
and not on other platforms, I'm going to need to
change xinetd anyways. Sus v3 does not mention
IPV6_ADDRFORM at all. 

>Also, if you are going to fix the indentation in 
>the header file, please do so in a seperate patch.

Hmmm, I only wanted to renumber the options since #1
was removed. Sorry if it changed the alignment.

Cheers,
-Steve Grubb

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] 2.5.40 - remove IPV6_ADDRFORM
  2002-10-03 13:57       ` Steve G
@ 2002-10-03 13:53         ` David S. Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David S. Miller @ 2002-10-03 13:53 UTC (permalink / raw)
  To: linux_4ever; +Cc: linux-kernel

   From: Steve G <linux_4ever@yahoo.com>
   Date: Thu, 3 Oct 2002 06:57:56 -0700 (PDT)

   >then every one of those ipv6 options you change 
   >which are being used by userspace breaks.
   
   I guess you're right. Smaller patch attached.
   
Still broken, you left IPV6_ADDRFORM in the header file.

Anyways, I'll take care of this myself and you can come back
with ipv6 contributions when NASA fixes their internal email
policy or you get a real ISP for linux kernel postings. :-)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] 2.5.40 - remove IPV6_ADDRFORM
  2002-10-03 13:32     ` David S. Miller
@ 2002-10-03 13:57       ` Steve G
  2002-10-03 13:53         ` David S. Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Steve G @ 2002-10-03 13:57 UTC (permalink / raw)
  To: David S. Miller; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 286 bytes --]

>then every one of those ipv6 options you change 
>which are being used by userspace breaks.

I guess you're right. Smaller patch attached.

-Steve Grubb




__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

[-- Attachment #2: 2.5-patch1.diff --]
[-- Type: text/plain, Size: 1734 bytes --]

diff -ur linux-2.5.40/net/ipv6/ipv6_sockglue.c linux-2.5.40a/net/ipv6/ipv6_sockglue.c
--- linux-2.5.40/net/ipv6/ipv6_sockglue.c	Tue Oct  1 03:06:16 2002
+++ linux-2.5.40a/net/ipv6/ipv6_sockglue.c	Thu Oct  3 07:23:59 2002
@@ -143,66 +143,6 @@
 
 	switch (optname) {
 
-	case IPV6_ADDRFORM:
-		if (val == PF_INET) {
-			struct ipv6_txoptions *opt;
-			struct sk_buff *pktopt;
-
-			if (sk->protocol != IPPROTO_UDP &&
-			    sk->protocol != IPPROTO_TCP)
-				break;
-
-			if (sk->state != TCP_ESTABLISHED) {
-				retv = -ENOTCONN;
-				break;
-			}
-
-			if (!(ipv6_addr_type(&np->daddr) & IPV6_ADDR_MAPPED)) {
-				retv = -EADDRNOTAVAIL;
-				break;
-			}
-
-			fl6_free_socklist(sk);
-			ipv6_sock_mc_close(sk);
-
-			if (sk->protocol == IPPROTO_TCP) {
-				struct tcp_opt *tp = tcp_sk(sk);
-
-				local_bh_disable();
-				sock_prot_dec_use(sk->prot);
-				sock_prot_inc_use(&tcp_prot);
-				local_bh_enable();
-				sk->prot = &tcp_prot;
-				tp->af_specific = &ipv4_specific;
-				sk->socket->ops = &inet_stream_ops;
-				sk->family = PF_INET;
-				tcp_sync_mss(sk, tp->pmtu_cookie);
-			} else {
-				local_bh_disable();
-				sock_prot_dec_use(sk->prot);
-				sock_prot_inc_use(&udp_prot);
-				local_bh_enable();
-				sk->prot = &udp_prot;
-				sk->socket->ops = &inet_dgram_ops;
-				sk->family = PF_INET;
-			}
-			opt = xchg(&np->opt, NULL);
-			if (opt)
-				sock_kfree_s(sk, opt, opt->tot_len);
-			pktopt = xchg(&np->pktoptions, NULL);
-			if (pktopt)
-				kfree_skb(pktopt);
-
-			sk->destruct = inet_sock_destruct;
-#ifdef INET_REFCNT_DEBUG
-			atomic_dec(&inet6_sock_nr);
-#endif
-			MOD_DEC_USE_COUNT;
-			retv = 0;
-			break;
-		}
-		goto e_inval;
-
 	case IPV6_PKTINFO:
 		np->rxopt.bits.rxinfo = valbool;
 		retv = 0;

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] 2.5.40 - remove IPV6_ADDRFORM
  2002-10-03 12:43 ` David S. Miller
  2002-10-03 13:36   ` Steve G
@ 2002-10-03 16:04   ` kuznet
  2002-10-03 16:04     ` David S. Miller
  1 sibling, 1 reply; 8+ messages in thread
From: kuznet @ 2002-10-03 16:04 UTC (permalink / raw)
  To: David S. Miller; +Cc: linux-kernel

Hello!

> Are we absolutely sure no applications use this?

To my shame I have to recognize: my local inetd/sendmail/ftpd still use it,
despite of all my many years snivels that it is mad-broken-crap-... :-)

Though, nothing to shame of, actually. IPV6_ADDRFORM was mad,
but IPv4 mapped addresses are mad^3. So, until IPV6_V6ONLY becomes usable,
port spaces are shared and the only way to write sane dual-protocol code
is IPV6_ADDRFORM.

:-) This is not objection against removal. Let it happen simultaneously
with IPV6_V6ONLY.

Alexey

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] 2.5.40 - remove IPV6_ADDRFORM
  2002-10-03 16:04   ` kuznet
@ 2002-10-03 16:04     ` David S. Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David S. Miller @ 2002-10-03 16:04 UTC (permalink / raw)
  To: kuznet; +Cc: linux-kernel

   From: kuznet@ms2.inr.ac.ru
   Date: Thu, 3 Oct 2002 20:04:03 +0400 (MSD)
   
   :-) This is not objection against removal. Let it happen simultaneously
   with IPV6_V6ONLY.

Ok, this is what we will do.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-10-03 16:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-03 12:45 [PATCH] 2.5.40 - remove IPV6_ADDRFORM Steve G
2002-10-03 12:43 ` David S. Miller
2002-10-03 13:36   ` Steve G
2002-10-03 13:32     ` David S. Miller
2002-10-03 13:57       ` Steve G
2002-10-03 13:53         ` David S. Miller
2002-10-03 16:04   ` kuznet
2002-10-03 16:04     ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).