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]
Date:	Mon, 01 Oct 2012 09:47:57 -0700
From:	Joe Perches <joe@...ches.com>
To:	Nicolas Dichtel <nicolas.dichtel@...nd.com>
Cc:	davem@...emloft.net, bernat@...fy.cx, netdev@...r.kernel.org,
	yoshfuji@...ux-ipv6.org
Subject: Re: [PATCH net-next v5 1/1] ipv6: add support of ECMP

On Mon, 2012-10-01 at 15:56 +0200, Nicolas Dichtel wrote:
> This patch adds the support of equal cost multipath for IPv6.

trivia:

> diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
[]
> @@ -47,6 +47,10 @@ struct fib6_config {
>  	unsigned long	fc_expires;
>  	struct nlattr	*fc_mx;
>  	int		fc_mx_len;
> +#ifdef CONFIG_IPV6_MULTIPATH
> +	struct nlattr	*fc_mp;
> +	int		fc_mp_len;
> +#endif

These new entries should be in the reverse order to
avoid having a padding hole in 64-bit systems.

> diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c

> @@ -672,6 +672,10 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,
>  			    iter->rt6i_idev == rt->rt6i_idev &&
>  			    ipv6_addr_equal(&iter->rt6i_gateway,
>  					    &rt->rt6i_gateway)) {
> +#ifdef CONFIG_IPV6_MULTIPATH
> +				if (rt->rt6i_nsiblings)
> +					rt->rt6i_nsiblings = 0;
> +#endif

There are a _lot_ of #ifdef CONFIG_IPV6_MULTIPATH blocks.

It might be better to add a few static line functions
in a header file like:

#ifdef CONFIG_IPV6_MULTIPATH
static inline int ipv6_get_multipath_siblings(const struct rt6_info *rt)
{
	return rt->rt6i_nsiblings;
}
#else
static inline int ipv6_get_multipath_siblings(const struct rt6_info *rt)
{
	return 0;
}
#endif

and remove most of the #ifdef blocks.


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