Re: [patch net-next v2] ipv6: log autoconfiguration failures

From: Hannes Frederic Sowa
Date: Wed Dec 11 2013 - 14:21:46 EST


On Wed, Dec 11, 2013 at 12:45:14PM +0100, Denys Vlasenko wrote:
> If ipv6 auto-configuration does not work, currently it's hard
> to track what's going on. This change adds log messages
> (at debug level) on every code path where ipv6 autoconf fails.
>
> v2: fixed indentation in multi-line log output statements.

Have you seen lots of those problems? Some of those seem like very
serious problems and maybe could also deserve a pr_warn or pr_err.

I hope these are one-time errors, so I don't think counters would
be helpful.

> Signed-off-by: Denys Vlasenko <dvlasenk@xxxxxxxxxx>
> ---
> net/ipv6/addrconf.c | 45 ++++++++++++++++++++++++++++++++++++---------
> 1 file changed, 36 insertions(+), 9 deletions(-)
>
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index 3c3425e..c09c5f4 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -1694,8 +1694,11 @@ static void addrconf_leave_anycast(struct inet6_ifaddr *ifp)
>
> static int addrconf_ifid_eui48(u8 *eui, struct net_device *dev)
> {
> - if (dev->addr_len != ETH_ALEN)
> + if (dev->addr_len != ETH_ALEN) {
> + pr_debug("IPv6 addrconf: %s: address length %d != %s\n",
> + dev->name, dev->addr_len, "ETH_ALEN");

I like __stringify(ETH_ALEN) instead of "ETH_ALEN" a bit more but no need
to change the patch because of that. ;)

> @@ -1842,6 +1865,10 @@ static int ipv6_inherit_eui64(u8 *eui, struct inet6_dev *idev)
> }
> }
> read_unlock_bh(&idev->lock);
> + if (err)
> + pr_debug("IPv6 addrconf: "
> + "%s: no link-local address to inherit\n",
> + idev->dev->name);

Another nit:
String literals should not be wrapped to ease grepping for them in the source.

Thanks,

Hannes

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/