From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Dichtel Subject: Re: [PATCH net-next] ip6_tunnel: ensure to always have a link local address Date: Wed, 21 Aug 2013 12:25:19 +0200 Message-ID: <5214958F.1080907@6wind.com> References: <1376993766-5723-1-git-send-email-nicolas.dichtel@6wind.com> <20130820.234818.2230621827416764963.davem@davemloft.net> <52146EE9.1060101@6wind.com> <87haej76wz.fsf@nemi.mork.no> Reply-To: nicolas.dichtel@6wind.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: David Miller , netdev@vger.kernel.org, yoshfuji@linux-ipv6.org To: =?UTF-8?B?QmrDuHJuIE1vcms=?= Return-path: Received: from mail-we0-f178.google.com ([74.125.82.178]:32913 "EHLO mail-we0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751487Ab3HUKZW (ORCPT ); Wed, 21 Aug 2013 06:25:22 -0400 Received: by mail-we0-f178.google.com with SMTP id u54so233921wes.9 for ; Wed, 21 Aug 2013 03:25:20 -0700 (PDT) In-Reply-To: <87haej76wz.fsf@nemi.mork.no> Sender: netdev-owner@vger.kernel.org List-ID: Le 21/08/2013 11:02, Bj=C3=B8rn Mork a =C3=A9crit : > Nicolas Dichtel writes: >> Le 21/08/2013 08:48, David Miller a =C3=A9crit : >> >>> Applied, but this brings up an issue I keep noticing. >>> >>> We talk about eth_random_addr() and "uniqueness" together all the >>> time, but the former never implies the latter. >>> >>> And we're going to run into situations where any conflicts generate= d >>> by this random address generater will cause reall failures. >>> >>> Therefore we'll have to create a system to prevent them. Probably >>> using some simple table that keeps track of the addresses we've >>> generated. >>> >> Ok, I will look at this. > > Are eth_random_addr() collisions really any different than interfaces > having the same address for other reasons? I would tend to say yes, it's different. It's easy for an administrator to fix a configuration for a physical in= terface,=20 because it's statically configured and there is a limited number of int= erfaces. =46or virtual interfaces, they can be dynamically created and destroyed= by daemons=20 and we can have a lot of interfaces. Hence it could be hard to fix them= =2E Trying=20 to avoid these errors at kernel level could be useful. I've start to write a patch, and to test it I've just run a simple test= which=20 generate 1 000 000 of random addresses. I've run it several times (mayb= e not=20 enough ;-)) and I never get a duplicated address...