mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Kamala R <kamala@aristanetworks.com>
Cc: davem@davemloft.net, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: IPv6: Blackhole route support partial ?
Date: Tue, 12 Nov 2013 14:54:12 +0100	[thread overview]
Message-ID: <20131112135412.GF14929@order.stressinduktion.org> (raw)
In-Reply-To: <CAP8BHkG6=KuU9K7=sGsZftMDe58eTYByRu2DZ+j+KNqcfsOfAA@mail.gmail.com>

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:
<https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/tree/Documentation/SubmittingPatches>

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


  reply	other threads:[~2013-11-12 13:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-11 13:55 Kamala R
2013-11-11 20:39 ` Hannes Frederic Sowa
2013-11-12 11:09   ` Kamala R
2013-11-12 13:54     ` Hannes Frederic Sowa [this message]
2013-11-14  8:20       ` Kamala R
2013-11-14 14:11         ` Hannes Frederic Sowa
2013-11-15  9:36           ` Kamala R
2013-11-15 13:48             ` Hannes Frederic Sowa
2013-11-20  4:48               ` Kamala R
2013-11-20  5:24                 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131112135412.GF14929@order.stressinduktion.org \
    --to=hannes@stressinduktion.org \
    --cc=davem@davemloft.net \
    --cc=kamala@aristanetworks.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®