linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch v3] IPv6: Fixed support for blackhole and prohibit routes
@ 2013-11-28  9:12 Kamala R
  2013-11-28 18:49 ` Hannes Frederic Sowa
  2013-11-28 19:04 ` [PATCH] ipv6: ip6_pkt_prohibit(_out) should not depend on CONFIG_IPV6_MULTIPLE_TABLES Hannes Frederic Sowa
  0 siblings, 2 replies; 8+ messages in thread
From: Kamala R @ 2013-11-28  9:12 UTC (permalink / raw)
  To: Hannes Frederic Sowa, netdev, David Miller; +Cc: linux-kernel, Kamala R

From: Kamala R <kamala@aristanetworks.com>

The behaviour of blackhole and prohibit routes has been corrected by setting
the input and output pointers of the dst variable appropriately. For
blackhole routes, they are set to dst_discard and to ip6_pkt_discard and
ip6_pkt_discard_out respectively for prohibit routes.

Signed-off-by: Kamala R <kamala@aristanetworks.com>
---
 net/ipv6/route.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 7faa9d5..97125c4 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1565,21 +1565,24 @@ int ip6_route_add(struct fib6_config *cfg)
 				goto out;
 			}
 		}
-		rt->dst.output = ip6_pkt_discard_out;
-		rt->dst.input = ip6_pkt_discard;
 		rt->rt6i_flags = RTF_REJECT|RTF_NONEXTHOP;
 		switch (cfg->fc_type) {
 		case RTN_BLACKHOLE:
 			rt->dst.error = -EINVAL;
+			rt->dst.output = dst_discard;
+			rt->dst.input = dst_discard;
 			break;
 		case RTN_PROHIBIT:
 			rt->dst.error = -EACCES;
+			rt->dst.output = ip6_pkt_prohibit_out;
+			rt->dst.input = ip6_pkt_prohibit;
 			break;
 		case RTN_THROW:
-			rt->dst.error = -EAGAIN;
-			break;
 		default:
-			rt->dst.error = -ENETUNREACH;
+			rt->dst.error = (cfg->fc_type == RTN_THROW) ? -EAGAIN
+					: -ENETUNREACH;
+			rt->dst.output = ip6_pkt_discard_out;
+			rt->dst.input = ip6_pkt_discard;
 			break;
 		}
 		goto install_route;
-- 
1.7.9.5


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

* Re: [Patch v3] IPv6: Fixed support for blackhole and prohibit routes
  2013-11-28  9:12 [Patch v3] IPv6: Fixed support for blackhole and prohibit routes Kamala R
@ 2013-11-28 18:49 ` Hannes Frederic Sowa
  2013-11-28 19:04 ` [PATCH] ipv6: ip6_pkt_prohibit(_out) should not depend on CONFIG_IPV6_MULTIPLE_TABLES Hannes Frederic Sowa
  1 sibling, 0 replies; 8+ messages in thread
From: Hannes Frederic Sowa @ 2013-11-28 18:49 UTC (permalink / raw)
  To: Kamala R; +Cc: netdev, David Miller, linux-kernel

On Thu, Nov 28, 2013 at 02:42:03PM +0530, Kamala R wrote:
> From: Kamala R <kamala@aristanetworks.com>
> 
> The behaviour of blackhole and prohibit routes has been corrected by setting
> the input and output pointers of the dst variable appropriately. For
> blackhole routes, they are set to dst_discard and to ip6_pkt_discard and
> ip6_pkt_discard_out respectively for prohibit routes.
> 
> Signed-off-by: Kamala R <kamala@aristanetworks.com>

Thanks for changing this once again!

Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>


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

* [PATCH] ipv6: ip6_pkt_prohibit(_out) should not depend on CONFIG_IPV6_MULTIPLE_TABLES
  2013-11-28  9:12 [Patch v3] IPv6: Fixed support for blackhole and prohibit routes Kamala R
  2013-11-28 18:49 ` Hannes Frederic Sowa
@ 2013-11-28 19:04 ` Hannes Frederic Sowa
  2013-11-29 21:39   ` David Miller
  1 sibling, 1 reply; 8+ messages in thread
From: Hannes Frederic Sowa @ 2013-11-28 19:04 UTC (permalink / raw)
  To: Kamala R; +Cc: netdev, David Miller, linux-kernel

Since patch "IPv6: Fixed support for blackhole and prohibit routes" we
need ip6_pkt_prohibit(_out) available without CONFIG_IPV6_MULTIPLE_TABLES
defined.

Cc: Kamala R <kamala@aristanetworks.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
 net/ipv6/route.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 97125c4..ddb9d41 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -84,6 +84,8 @@ static int		 ip6_dst_gc(struct dst_ops *ops);
 
 static int		ip6_pkt_discard(struct sk_buff *skb);
 static int		ip6_pkt_discard_out(struct sk_buff *skb);
+static int		ip6_pkt_prohibit(struct sk_buff *skb);
+static int		ip6_pkt_prohibit_out(struct sk_buff *skb);
 static void		ip6_link_failure(struct sk_buff *skb);
 static void		ip6_rt_update_pmtu(struct dst_entry *dst, struct sock *sk,
 					   struct sk_buff *skb, u32 mtu);
@@ -234,9 +236,6 @@ static const struct rt6_info ip6_null_entry_template = {
 
 #ifdef CONFIG_IPV6_MULTIPLE_TABLES
 
-static int ip6_pkt_prohibit(struct sk_buff *skb);
-static int ip6_pkt_prohibit_out(struct sk_buff *skb);
-
 static const struct rt6_info ip6_prohibit_entry_template = {
 	.dst = {
 		.__refcnt	= ATOMIC_INIT(1),
@@ -2147,8 +2146,6 @@ static int ip6_pkt_discard_out(struct sk_buff *skb)
 	return ip6_pkt_drop(skb, ICMPV6_NOROUTE, IPSTATS_MIB_OUTNOROUTES);
 }
 
-#ifdef CONFIG_IPV6_MULTIPLE_TABLES
-
 static int ip6_pkt_prohibit(struct sk_buff *skb)
 {
 	return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_INNOROUTES);
@@ -2160,8 +2157,6 @@ static int ip6_pkt_prohibit_out(struct sk_buff *skb)
 	return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES);
 }
 
-#endif
-
 /*
  *	Allocate a dst for local (unicast / anycast) address.
  */
-- 
1.8.3.1


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

* Re: [PATCH] ipv6: ip6_pkt_prohibit(_out) should not depend on CONFIG_IPV6_MULTIPLE_TABLES
  2013-11-28 19:04 ` [PATCH] ipv6: ip6_pkt_prohibit(_out) should not depend on CONFIG_IPV6_MULTIPLE_TABLES Hannes Frederic Sowa
@ 2013-11-29 21:39   ` David Miller
  2013-11-30 17:46     ` Hannes Frederic Sowa
  0 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2013-11-29 21:39 UTC (permalink / raw)
  To: hannes; +Cc: kamala, netdev, linux-kernel

From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Thu, 28 Nov 2013 20:04:11 +0100

> Since patch "IPv6: Fixed support for blackhole and prohibit routes" we
> need ip6_pkt_prohibit(_out) available without CONFIG_IPV6_MULTIPLE_TABLES
> defined.
> 
> Cc: Kamala R <kamala@aristanetworks.com>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>

Please reference the SHA1 ID of the change as well as it's commit
header text, thank you.

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

* Re: [PATCH] ipv6: ip6_pkt_prohibit(_out) should not depend on CONFIG_IPV6_MULTIPLE_TABLES
  2013-11-29 21:39   ` David Miller
@ 2013-11-30 17:46     ` Hannes Frederic Sowa
  2013-11-30 17:51       ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Hannes Frederic Sowa @ 2013-11-30 17:46 UTC (permalink / raw)
  To: David Miller; +Cc: kamala, netdev, linux-kernel

On Fri, Nov 29, 2013 at 04:39:30PM -0500, David Miller wrote:
> From: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Date: Thu, 28 Nov 2013 20:04:11 +0100
> 
> > Since patch "IPv6: Fixed support for blackhole and prohibit routes" we
> > need ip6_pkt_prohibit(_out) available without CONFIG_IPV6_MULTIPLE_TABLES
> > defined.
> > 
> > Cc: Kamala R <kamala@aristanetworks.com>
> > Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> 
> Please reference the SHA1 ID of the change as well as it's commit
> header text, thank you.

This patch is a follow-up patch for the first one in this thread which is not
committed, yet. Either Kamala can squash them into one or I'll repost it
later.

Greetings,

  Hannes


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

* Re: [PATCH] ipv6: ip6_pkt_prohibit(_out) should not depend on CONFIG_IPV6_MULTIPLE_TABLES
  2013-11-30 17:46     ` Hannes Frederic Sowa
@ 2013-11-30 17:51       ` David Miller
  2013-11-30 17:59         ` Hannes Frederic Sowa
  0 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2013-11-30 17:51 UTC (permalink / raw)
  To: hannes; +Cc: kamala, netdev, linux-kernel

From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Sat, 30 Nov 2013 18:46:35 +0100

> On Fri, Nov 29, 2013 at 04:39:30PM -0500, David Miller wrote:
>> From: Hannes Frederic Sowa <hannes@stressinduktion.org>
>> Date: Thu, 28 Nov 2013 20:04:11 +0100
>> 
>> > Since patch "IPv6: Fixed support for blackhole and prohibit routes" we
>> > need ip6_pkt_prohibit(_out) available without CONFIG_IPV6_MULTIPLE_TABLES
>> > defined.
>> > 
>> > Cc: Kamala R <kamala@aristanetworks.com>
>> > Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
>> 
>> Please reference the SHA1 ID of the change as well as it's commit
>> header text, thank you.
> 
> This patch is a follow-up patch for the first one in this thread which is not
> committed, yet. Either Kamala can squash them into one or I'll repost it
> later.

I think they need to be combined, otherwise bisection is broken.

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

* Re: [PATCH] ipv6: ip6_pkt_prohibit(_out) should not depend on CONFIG_IPV6_MULTIPLE_TABLES
  2013-11-30 17:51       ` David Miller
@ 2013-11-30 17:59         ` Hannes Frederic Sowa
  2013-12-02 14:28           ` Kamala R
  0 siblings, 1 reply; 8+ messages in thread
From: Hannes Frederic Sowa @ 2013-11-30 17:59 UTC (permalink / raw)
  To: David Miller; +Cc: kamala, netdev, linux-kernel

On Sat, Nov 30, 2013 at 12:51:10PM -0500, David Miller wrote:
> From: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Date: Sat, 30 Nov 2013 18:46:35 +0100
> 
> > On Fri, Nov 29, 2013 at 04:39:30PM -0500, David Miller wrote:
> >> From: Hannes Frederic Sowa <hannes@stressinduktion.org>
> >> Date: Thu, 28 Nov 2013 20:04:11 +0100
> >> 
> >> > Since patch "IPv6: Fixed support for blackhole and prohibit routes" we
> >> > need ip6_pkt_prohibit(_out) available without CONFIG_IPV6_MULTIPLE_TABLES
> >> > defined.
> >> > 
> >> > Cc: Kamala R <kamala@aristanetworks.com>
> >> > Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> >> 
> >> Please reference the SHA1 ID of the change as well as it's commit
> >> header text, thank you.
> > 
> > This patch is a follow-up patch for the first one in this thread which is not
> > committed, yet. Either Kamala can squash them into one or I'll repost it
> > later.
> 
> I think they need to be combined, otherwise bisection is broken.

Kamala, as your patch is the main one, can you squash my patch into yours?


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

* Re: [PATCH] ipv6: ip6_pkt_prohibit(_out) should not depend on CONFIG_IPV6_MULTIPLE_TABLES
  2013-11-30 17:59         ` Hannes Frederic Sowa
@ 2013-12-02 14:28           ` Kamala R
  0 siblings, 0 replies; 8+ messages in thread
From: Kamala R @ 2013-12-02 14:28 UTC (permalink / raw)
  To: David Miller, Kamala R, netdev, linux-kernel, Hannes Frederic Sowa

Hi,

I have submitted a version 4 of my patch that squashes the above
changes into it as well. Is that the right way to do it ?

Regards,
Kamala

On Sat, Nov 30, 2013 at 11:29 PM, Hannes Frederic Sowa
<hannes@stressinduktion.org> wrote:
> On Sat, Nov 30, 2013 at 12:51:10PM -0500, David Miller wrote:
>> From: Hannes Frederic Sowa <hannes@stressinduktion.org>
>> Date: Sat, 30 Nov 2013 18:46:35 +0100
>>
>> > On Fri, Nov 29, 2013 at 04:39:30PM -0500, David Miller wrote:
>> >> From: Hannes Frederic Sowa <hannes@stressinduktion.org>
>> >> Date: Thu, 28 Nov 2013 20:04:11 +0100
>> >>
>> >> > Since patch "IPv6: Fixed support for blackhole and prohibit routes" we
>> >> > need ip6_pkt_prohibit(_out) available without CONFIG_IPV6_MULTIPLE_TABLES
>> >> > defined.
>> >> >
>> >> > Cc: Kamala R <kamala@aristanetworks.com>
>> >> > Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
>> >>
>> >> Please reference the SHA1 ID of the change as well as it's commit
>> >> header text, thank you.
>> >
>> > This patch is a follow-up patch for the first one in this thread which is not
>> > committed, yet. Either Kamala can squash them into one or I'll repost it
>> > later.
>>
>> I think they need to be combined, otherwise bisection is broken.
>
> Kamala, as your patch is the main one, can you squash my patch into yours?
>

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

end of thread, other threads:[~2013-12-02 14:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-28  9:12 [Patch v3] IPv6: Fixed support for blackhole and prohibit routes Kamala R
2013-11-28 18:49 ` Hannes Frederic Sowa
2013-11-28 19:04 ` [PATCH] ipv6: ip6_pkt_prohibit(_out) should not depend on CONFIG_IPV6_MULTIPLE_TABLES Hannes Frederic Sowa
2013-11-29 21:39   ` David Miller
2013-11-30 17:46     ` Hannes Frederic Sowa
2013-11-30 17:51       ` David Miller
2013-11-30 17:59         ` Hannes Frederic Sowa
2013-12-02 14:28           ` Kamala R

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