From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hannes Frederic Sowa Subject: Re: IPv6: Blackhole route support partial ? Date: Tue, 12 Nov 2013 14:54:12 +0100 Message-ID: <20131112135412.GF14929@order.stressinduktion.org> References: <20131111203954.GB3043@order.stressinduktion.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: davem@davemloft.net, linux-kernel@vger.kernel.org, netdev@vger.kernel.org To: Kamala R Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Tue, Nov 12, 2013 at 04:39:10PM +0530, Kamala R wrote: > Hi, > > Sure, here it is. > > --- linux-3.12/net/ipv6/route.c.orig 2013-11-12 16:23:46.000000000 +0530 > +++ linux-3.12/net/ipv6/route.c 2013-11-12 16:30:51.000000000 +0530 > @@ -1570,9 +1570,13 @@ int ip6_route_add(struct fib6_config *cf > switch (cfg->fc_type) { > case RTN_BLACKHOLE: > rt->dst.error = -EINVAL; > + rt->dst.input = dst_discard; > + rt->dst.discard = dst_discard; > break; > case RTN_PROHIBIT: > rt->dst.error = -EACCES; > + rt->dst.input = ip6_pkt_prohibit; > + rt->dst.output = ip6_pkt_prohibit_out; > break; > case RTN_THROW: > rt->dst.error = -EAGAIN; > > Is this ok ? I woud move all the initialization of the function pointer into the switch-case. You could merge the case RTN_THROW with the default one by just using a ternary statement to initialize dst.error. Your patch must be well-formed to get included into the kernel. For that you should base your patch ontop net-next or net, write a proper commit message and send the git format-patch generated patch to this list. Here some hints: You can check if your formatting is correct by using scripts/checkpatch --strict. Let me know if there are any problems with that. Thank you, Hannes