lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131123224116.GH15822@order.stressinduktion.org>
Date:	Sat, 23 Nov 2013 23:41:16 +0100
From:	Hannes Frederic Sowa <hannes@...essinduktion.org>
To:	Kamala R <kamala@...stanetworks.com>
Cc:	netdev@...r.kernel.org, David Miller <davem@...emloft.net>,
	linux-kernel@...r.kernel.org
Subject: Re: [Patch v2] IPv6: Fixed support for blackhole and prohibit routes

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. 

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ