From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Kamala R <kamala@aristanetworks.com>
Cc: netdev@vger.kernel.org, David Miller <davem@davemloft.net>,
linux-kernel@vger.kernel.org
Subject: Re: [Patch v2] IPv6: Fixed support for blackhole and prohibit routes
Date: Sat, 23 Nov 2013 23:41:16 +0100 [thread overview]
Message-ID: <20131123224116.GH15822@order.stressinduktion.org> (raw)
In-Reply-To: <1385108488-32163-1-git-send-email-kamala@aristanetwors.com>
On Fri, Nov 22, 2013 at 01:51:28PM +0530, Kamala R wrote:
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index f54e3a1..d90b9ab 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -1564,21 +1564,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;
> + rt->dst.error = -ENETUNREACH;
> 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.output = ip6_pkt_discard_out;
> + rt->dst.input = ip6_pkt_discard;
> break;
> }
> goto install_route;
I like it more if a variable is only assigned once. Otherwise it is fine by
me.
next prev parent reply other threads:[~2013-11-23 22:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-22 8:21 [Patch v2] IPv6: Fixed support for blackhole and prohibit routes Kamala R
2013-11-23 22:41 ` Hannes Frederic Sowa [this message]
2013-11-28 18:50 ` Hannes Frederic Sowa
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=20131123224116.GH15822@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