Re: [PATCH] IPv4: Enable use of 240/4 address space

2008-01-21 Thread David Miller
From: YOSHIFUJI Hideaki / 吉藤英明 <[EMAIL PROTECTED]>
Date: Sun, 20 Jan 2008 00:30:19 +0900 (JST)

> In article <[EMAIL PROTECTED]> (at Sat, 19 Jan 2008 14:44:13 +0100 (CET)), 
> Jan Engelhardt <[EMAIL PROTECTED]> says:
> 
> > From 84bccef295aa9754ee662191e32ba1d64edce2ba Mon Sep 17 00:00:00 2001
> > From: Jan Engelhardt <[EMAIL PROTECTED]>
> > Date: Fri, 18 Jan 2008 02:10:44 +0100
> > Subject: [PATCH] IPv4: enable use of 240/4 address space
> > 
> > This short patch modifies the IPv4 networking to enable use of the
> > 240.0.0.0/4 (aka "class-E") address space as propsed in the internet
> > draft draft-fuller-240space-00.txt.
> > 
> > Signed-off-by: Jan Engelhardt <[EMAIL PROTECTED]>
> Acked-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>

I've applied this to net-2.6.25, thanks everyone.

I know I said we should deploy this as fast as possible,
but we are really coming down the wire as far as releasing
2.6.24 is concerned and I don't want to put anything into
my pushes to Linus that he might not like and thus cause
the entire set of bug fixes to be rejected.

Thanks again.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] IPv4: Enable use of 240/4 address space

2008-01-19 Thread YOSHIFUJI Hideaki / 吉藤英明
In article <[EMAIL PROTECTED]> (at Sat, 19 Jan 2008 14:44:13 +0100 (CET)), Jan 
Engelhardt <[EMAIL PROTECTED]> says:

> From 84bccef295aa9754ee662191e32ba1d64edce2ba Mon Sep 17 00:00:00 2001
> From: Jan Engelhardt <[EMAIL PROTECTED]>
> Date: Fri, 18 Jan 2008 02:10:44 +0100
> Subject: [PATCH] IPv4: enable use of 240/4 address space
> 
> This short patch modifies the IPv4 networking to enable use of the
> 240.0.0.0/4 (aka "class-E") address space as propsed in the internet
> draft draft-fuller-240space-00.txt.
> 
> Signed-off-by: Jan Engelhardt <[EMAIL PROTECTED]>
Acked-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>

--yoshfuji
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] IPv4: Enable use of 240/4 address space

2008-01-19 Thread Jan Engelhardt

On Jan 18 2008 11:13, YOSHIFUJI Hideaki / 吉藤英明 wrote:
>> -static inline bool ipv4_is_badclass(__be32 addr)
>> +static inline bool ipv4_is_broadcast(__be32 addr)
>>  {
>
>I'm just afraid that people might think ipv4_is_broadcast
>is for testing subnet broadcast address.
>
>255.255.255.255 is "limited broadcast address"
>(vs subnet broadcast address, which can be forwarded by routers).



>From 84bccef295aa9754ee662191e32ba1d64edce2ba Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <[EMAIL PROTECTED]>
Date: Fri, 18 Jan 2008 02:10:44 +0100
Subject: [PATCH] IPv4: enable use of 240/4 address space

This short patch modifies the IPv4 networking to enable use of the
240.0.0.0/4 (aka "class-E") address space as propsed in the internet
draft draft-fuller-240space-00.txt.

Signed-off-by: Jan Engelhardt <[EMAIL PROTECTED]>
---
 include/linux/in.h  |5 +++--
 include/net/addrconf.h  |2 +-
 net/core/pktgen.c   |2 +-
 net/ipv4/fib_frontend.c |2 +-
 net/ipv4/route.c|   12 ++--
 5 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/include/linux/in.h b/include/linux/in.h
index 27d8a5a..70c6df8 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -262,9 +262,10 @@ static inline bool ipv4_is_local_multicast(__be32 addr)
return (addr & htonl(0xff00)) == htonl(0xe000);
 }
 
-static inline bool ipv4_is_badclass(__be32 addr)
+static inline bool ipv4_is_lbcast(__be32 addr)
 {
-   return (addr & htonl(0xf000)) == htonl(0xf000);
+   /* limited broadcast */
+   return addr == INADDR_BROADCAST;
 }
 
 static inline bool ipv4_is_zeronet(__be32 addr)
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 8b1509b..496503c 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -262,7 +262,7 @@ static inline int ipv6_isatap_eui64(u8 *eui, __be32 addr)
  ipv4_is_private_172(addr) || ipv4_is_test_192(addr) ||
  ipv4_is_anycast_6to4(addr) || ipv4_is_private_192(addr) ||
  ipv4_is_test_198(addr) || ipv4_is_multicast(addr) ||
- ipv4_is_badclass(addr)) ? 0x00 : 0x02;
+ ipv4_is_lbcast(addr)) ? 0x00 : 0x02;
eui[1] = 0;
eui[2] = 0x5E;
eui[3] = 0xFE;
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index d18fdb1..eebccdb 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2266,7 +2266,7 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
 
while (ipv4_is_loopback(s) ||
   ipv4_is_multicast(s) ||
-  ipv4_is_badclass(s) ||
+  ipv4_is_lbcast(s) ||
   ipv4_is_zeronet(s) ||
   ipv4_is_local_multicast(s)) {
t = random32() % (imx - imn) + 
imn;
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 8ddcd3f..995b453 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -176,7 +176,7 @@ static inline unsigned __inet_dev_addr_type(struct net *net,
unsigned ret = RTN_BROADCAST;
struct fib_table *local_table;
 
-   if (ipv4_is_zeronet(addr) || ipv4_is_badclass(addr))
+   if (ipv4_is_zeronet(addr) || ipv4_is_lbcast(addr))
return RTN_BROADCAST;
if (ipv4_is_multicast(addr))
return RTN_MULTICAST;
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 1e59c0d..1e484f7 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1154,7 +1154,7 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 
new_gw,
return;
 
if (new_gw == old_gw || !IN_DEV_RX_REDIRECTS(in_dev)
-   || ipv4_is_multicast(new_gw) || ipv4_is_badclass(new_gw)
+   || ipv4_is_multicast(new_gw) || ipv4_is_lbcast(new_gw)
|| ipv4_is_zeronet(new_gw))
goto reject_redirect;
 
@@ -1634,7 +1634,7 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 
daddr, __be32 saddr,
if (in_dev == NULL)
return -EINVAL;
 
-   if (ipv4_is_multicast(saddr) || ipv4_is_badclass(saddr) ||
+   if (ipv4_is_multicast(saddr) || ipv4_is_lbcast(saddr) ||
ipv4_is_loopback(saddr) || skb->protocol != htons(ETH_P_IP))
goto e_inval;
 
@@ -1891,7 +1891,7 @@ static int ip_route_input_slow(struct sk_buff *skb, 
__be32 daddr, __be32 saddr,
   by fib_lookup.
 */
 
-   if (ipv4_is_multicast(saddr) || ipv4_is_badclass(saddr) ||
+   if (ipv4_is_multicast(saddr) || ipv4_is_lbcast(saddr) ||
ipv4_is_loopback(saddr))
goto martian_source;
 
@@ -1904,7 +1904,7 @@ static int ip_route_input_slow(struct sk_buff *skb, 
__be32 daddr, __be32 saddr

Re: [PATCH] IPv4: Enable use of 240/4 address space

2008-01-17 Thread YOSHIFUJI Hideaki / 吉藤英明
In article <[EMAIL PROTECTED]> (at Fri, 18 Jan 2008 11:13:19 +0900 (JST)), 
YOSHIFUJI Hideaki / 吉藤英明 <[EMAIL PROTECTED]> says:

> Assuming IN_BADCLASS() is still there, we should not reuse the name
> of "ipv6_is_badclass" because the their meanings are different.

Again, ipv4_is_badclass()
My hands almost automatically type "6" after "ipv"...

--yoshfuji
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] IPv4: Enable use of 240/4 address space

2008-01-17 Thread YOSHIFUJI Hideaki / 吉藤英明
In article <[EMAIL PROTECTED]> (at Fri, 18 Jan 2008 02:52:08 +0100 (CET)), Jan 
Engelhardt <[EMAIL PROTECTED]> says:

> 
> On Jan 18 2008 10:26, YOSHIFUJI Hideaki / 吉藤英明 wrote:
> >> -#define   IN_EXPERIMENTAL(a)  long int) (a)) & 0xf000) == 
> >> 0xf000)
> >> -#define   IN_BADCLASS(a)  IN_EXPERIMENTAL((a))
> >
> >No, please keep these macros.
> >
> >> @@ -264,7 +261,7 @@ static inline bool ipv4_is_local_multicast(__be32 addr)
> >>  
> >>  static inline bool ipv4_is_badclass(__be32 addr)
> >>  {
> >> -  return (addr & htonl(0xf000)) == htonl(0xf000);
> >> +  return addr == 0x;
> >>  }
> >>  
> >
> >To (un)align the IN_BADCLASS macro and ipv6_is_badclass() definition,
> 
> Unalign? IPv6? "Limited" broadcast?

Sorry, ipv4_is_badclass().
Assuming IN_BADCLASS() is still there, we should not reuse the name
of "ipv6_is_badclass" because the their meanings are different.

> -static inline bool ipv4_is_badclass(__be32 addr)
> +static inline bool ipv4_is_broadcast(__be32 addr)
>  {

I'm just afraid that people might think ipv4_is_broadcast
is for testing subnet broadcast address.

255.255.255.255 is "limited broadcast address"
(vs subnet broadcast address, which can be forwarded by routers).

--yoshfuji
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] IPv4: Enable use of 240/4 address space

2008-01-17 Thread Jan Engelhardt

On Jan 18 2008 10:26, YOSHIFUJI Hideaki / 吉藤英明 wrote:
>> -#define IN_EXPERIMENTAL(a)  long int) (a)) & 0xf000) == 
>> 0xf000)
>> -#define IN_BADCLASS(a)  IN_EXPERIMENTAL((a))
>
>No, please keep these macros.
>
>> @@ -264,7 +261,7 @@ static inline bool ipv4_is_local_multicast(__be32 addr)
>>  
>>  static inline bool ipv4_is_badclass(__be32 addr)
>>  {
>> -return (addr & htonl(0xf000)) == htonl(0xf000);
>> +return addr == 0x;
>>  }
>>  
>
>To (un)align the IN_BADCLASS macro and ipv6_is_badclass() definition,

Unalign? IPv6? "Limited" broadcast?

>you should change the name anyway, e.g., ipv6_is_limited_broadcast()
>or some something alike.

===
Author: Jan Engelhardt <[EMAIL PROTECTED]>
Date:   Fri Jan 18 02:51:34 2008 +0100

IPv4: enable use of 240/4 address space

This short patch modifies the IPv4 networking to enable use of the
240.0.0.0/4 (aka "class-E") address space as propsed in the internet
draft draft-fuller-240space-00.txt.

Signed-off-by: Jan Engelhardt <[EMAIL PROTECTED]>

diff --git a/include/linux/in.h b/include/linux/in.h
index 27d8a5a..4887768 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -262,9 +262,9 @@ static inline bool ipv4_is_local_multicast(__be32 addr)
return (addr & htonl(0xff00)) == htonl(0xe000);
 }
 
-static inline bool ipv4_is_badclass(__be32 addr)
+static inline bool ipv4_is_broadcast(__be32 addr)
 {
-   return (addr & htonl(0xf000)) == htonl(0xf000);
+   return addr == 0x;
 }
 
 static inline bool ipv4_is_zeronet(__be32 addr)
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 8b1509b..f5bd33b 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -262,7 +262,7 @@ static inline int ipv6_isatap_eui64(u8 *eui, __be32 addr)
  ipv4_is_private_172(addr) || ipv4_is_test_192(addr) ||
  ipv4_is_anycast_6to4(addr) || ipv4_is_private_192(addr) ||
  ipv4_is_test_198(addr) || ipv4_is_multicast(addr) ||
- ipv4_is_badclass(addr)) ? 0x00 : 0x02;
+ ipv4_is_broadcast(addr)) ? 0x00 : 0x02;
eui[1] = 0;
eui[2] = 0x5E;
eui[3] = 0xFE;
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index d18fdb1..9d6e7af 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2266,7 +2266,7 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
 
while (ipv4_is_loopback(s) ||
   ipv4_is_multicast(s) ||
-  ipv4_is_badclass(s) ||
+  ipv4_is_broadcast(s) ||
   ipv4_is_zeronet(s) ||
   ipv4_is_local_multicast(s)) {
t = random32() % (imx - imn) + 
imn;
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 8ddcd3f..367e097 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -176,7 +176,7 @@ static inline unsigned __inet_dev_addr_type(struct net *net,
unsigned ret = RTN_BROADCAST;
struct fib_table *local_table;
 
-   if (ipv4_is_zeronet(addr) || ipv4_is_badclass(addr))
+   if (ipv4_is_zeronet(addr) || ipv4_is_broadcast(addr))
return RTN_BROADCAST;
if (ipv4_is_multicast(addr))
return RTN_MULTICAST;
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 1e59c0d..9f0ea73 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1154,7 +1154,7 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 
new_gw,
return;
 
if (new_gw == old_gw || !IN_DEV_RX_REDIRECTS(in_dev)
-   || ipv4_is_multicast(new_gw) || ipv4_is_badclass(new_gw)
+   || ipv4_is_multicast(new_gw) || ipv4_is_broadcast(new_gw)
|| ipv4_is_zeronet(new_gw))
goto reject_redirect;
 
@@ -1634,7 +1634,7 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 
daddr, __be32 saddr,
if (in_dev == NULL)
return -EINVAL;
 
-   if (ipv4_is_multicast(saddr) || ipv4_is_badclass(saddr) ||
+   if (ipv4_is_multicast(saddr) || ipv4_is_broadcast(saddr) ||
ipv4_is_loopback(saddr) || skb->protocol != htons(ETH_P_IP))
goto e_inval;
 
@@ -1891,7 +1891,7 @@ static int ip_route_input_slow(struct sk_buff *skb, 
__be32 daddr, __be32 saddr,
   by fib_lookup.
 */
 
-   if (ipv4_is_multicast(saddr) || ipv4_is_badclass(saddr) ||
+   if (ipv4_is_multicast(saddr) || ipv4_is_broadcast(saddr) ||
ipv4_is_loopback(saddr))
goto martian_source;
 
@@ -1904,7 +1904,7 @@ static int ip_route_input_slow(struct sk_buff *skb, 
__be32 daddr, __be32 saddr,
if (ipv4_is_zeronet(saddr))
goto martian_source;
 
-   if (ipv4_is_badclas

Re: [PATCH] IPv4: Enable use of 240/4 address space

2008-01-17 Thread YOSHIFUJI Hideaki / 吉藤英明
In article <[EMAIL PROTECTED]> (at Fri, 18 Jan 2008 02:13:52 +0100 (CET)), Jan 
Engelhardt <[EMAIL PROTECTED]> says:

> diff --git a/include/linux/in.h b/include/linux/in.h
> index 27d8a5a..b01bf75 100644
> --- a/include/linux/in.h
> +++ b/include/linux/in.h
> @@ -216,9 +216,6 @@ struct sockaddr_in {
>  #define  IN_MULTICAST(a) IN_CLASSD(a)
>  #define IN_MULTICAST_NET 0xF000
>  
> -#define  IN_EXPERIMENTAL(a)  long int) (a)) & 0xf000) == 
> 0xf000)
> -#define  IN_BADCLASS(a)  IN_EXPERIMENTAL((a))
> -
>  /* Address to accept any incoming messages. */
>  #define  INADDR_ANY  ((unsigned long int) 0x)
>  

No, please keep these macros.

> @@ -264,7 +261,7 @@ static inline bool ipv4_is_local_multicast(__be32 addr)
>  
>  static inline bool ipv4_is_badclass(__be32 addr)
>  {
> - return (addr & htonl(0xf000)) == htonl(0xf000);
> + return addr == 0x;
>  }
>  

To (un)align the IN_BADCLASS macro and ipv6_is_badclass() definition,
you should change the name anyway, e.g., ipv6_is_limited_broadcast()
or some something alike.

--yoshfuji
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] IPv4: Enable use of 240/4 address space

2008-01-17 Thread Jan Engelhardt

On Jan 7 2008 17:10, Vince Fuller wrote:
>
>This set of diffs modify the 2.6.20 kernel to enable use of the 240/4
>(aka "class-E") address space as consistent with the Internet Draft
>draft-fuller-240space-00.txt.
>

Below is a patch against davem/net-2.6.25. It might look very spartan, 
but that is actually all that is needed on a sane system. No class E 
macros or so needed.

Only the ipv4_is_badclass() might need renaming if you think it really 
needs a name change. Or maybe a comment. Comments please :)

===
ancestor 7651a1f7ebe567f9088283f6354a5634b5dccb8e
commit 44762168d7cbefc4f8753a79d99a761cbd9875d9
Author: Jan Engelhardt <[EMAIL PROTECTED]>
Date:   Fri Jan 18 02:10:44 2008 +0100

IPv4: enable use of 240/4 address space

This short patch modifies the IPv4 networking to enable use of the
240.0.0.0/4 (aka "class-E") address space as propsed in the internet
draft draft-fuller-240space-00.txt.

Signed-off-by: Jan Engelhardt <[EMAIL PROTECTED]>

diff --git a/include/linux/in.h b/include/linux/in.h
index 27d8a5a..b01bf75 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -216,9 +216,6 @@ struct sockaddr_in {
 #defineIN_MULTICAST(a) IN_CLASSD(a)
 #define IN_MULTICAST_NET   0xF000
 
-#defineIN_EXPERIMENTAL(a)  long int) (a)) & 0xf000) == 
0xf000)
-#defineIN_BADCLASS(a)  IN_EXPERIMENTAL((a))
-
 /* Address to accept any incoming messages. */
 #defineINADDR_ANY  ((unsigned long int) 0x)
 
@@ -264,7 +261,7 @@ static inline bool ipv4_is_local_multicast(__be32 addr)
 
 static inline bool ipv4_is_badclass(__be32 addr)
 {
-   return (addr & htonl(0xf000)) == htonl(0xf000);
+   return addr == 0x;
 }
 
 static inline bool ipv4_is_zeronet(__be32 addr)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html