From owner-freebsd-current@freebsd.org Wed Jan 13 18:17:23 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9D14A81886; Wed, 13 Jan 2016 18:17:23 +0000 (UTC) (envelope-from hoomanfazaeli@gmail.com) Received: from mail-pa0-x22a.google.com (mail-pa0-x22a.google.com [IPv6:2607:f8b0:400e:c03::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7F791575; Wed, 13 Jan 2016 18:17:23 +0000 (UTC) (envelope-from hoomanfazaeli@gmail.com) Received: by mail-pa0-x22a.google.com with SMTP id ho8so101387660pac.2; Wed, 13 Jan 2016 10:17:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=XN4HFhDGroZ2PDHcmmacJkLs2Bjnv8mzltLdIffGnQU=; b=TivP3SVKkZHxiAqTXG6cN3VRxJ/pNNEeBfT56/EhwD9S3h69jDPNY6hRlidBZF0n/3 UzTF/AvwFM6vlQjDSpa4p6gZ7tQpc3w3chFZ9mFKYoWjgCxgO6JUA1/D4ZMXwwhjg83n nCdU5GVtA5l68M2Bchbd/WVEsUetvPAVNZk5+RGBFHesUl/jut5CECUJWap+Iq2JpDKP IergXkijsQyARVAm/k70oB2A8gM7FNeoelT2Vu2NwvdeF3dlFNxahKAfIEfrn6A3KUn2 O/ELkgxie36hwhwJM+oOMTbgRcPZnJGdXjqTFjY2Cx1tgQctgFeVEn4dHP16iV0A1Lcy YTQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=XN4HFhDGroZ2PDHcmmacJkLs2Bjnv8mzltLdIffGnQU=; b=jJIuQBy2NuMvezuyhueZP1Nqk8rifmkVkVUYUhpE4eWGu5bRHZ09XjPUB6eVj5FTSr HOqXQLGs6+9UEk/4qeBUjfPmJeIIakWoypEzrhBDLFuLsShOpJeyXLuIHiANC7X/jUCs MfEuIj5BjBRb+QmvMKhPW0hL1UDXc1XExk3AEhFDowQFUyGN+KZh9JwhEWbZhlcorcS4 lNBNmzmKClwYPn1igXEyQsL06XLdwW+qj0QmkCI1bYFDjrEV7IYv6OQNXHt9lt/moE5X mLXX4t9NIS5qhsUIQhqGDW6EKwkHbNRUVSnrleLa63wOwO1qgTp9CGE0ZhBfXKGbO/t8 h7WQ== X-Gm-Message-State: ALoCoQn0zfUM47abOttgzOOq4TCkBqO2gwvwt9dAuQUB8CpJCrvbcCZglvgxKA4wjmXq9f6Jog1ABvDa42iJvO5pUPnS04B3Fw== X-Received: by 10.66.122.72 with SMTP id lq8mr198403253pab.1.1452709043298; Wed, 13 Jan 2016 10:17:23 -0800 (PST) Received: from [192.168.2.30] ([188.209.47.246]) by smtp.googlemail.com with ESMTPSA id w22sm4082440pfa.79.2016.01.13.10.17.17 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 13 Jan 2016 10:17:22 -0800 (PST) Message-ID: <569694A7.9030200@gmail.com> Date: Wed, 13 Jan 2016 21:47:11 +0330 From: Hooman Fazaeli User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 MIME-Version: 1.0 To: =?UTF-8?B?T2xpdmllciBDb2NoYXJkLUxhYmLDqQ==?= CC: "Alexander V. Chernikov" , "freebsd-current@freebsd.org" , "freebsd-wireless@freebsd.org" Subject: Re: forwarding didn't work if wlan0 is member of a bridge References: <1223091452631961@web14j.yandex.ru> <2985841452674737@web5h.yandex.ru> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Wed, 13 Jan 2016 18:19:45 +0000 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 18:17:23 -0000 On 1/13/2016 1:31 PM, Olivier Cochard-Labbé wrote: > On Wed, Jan 13, 2016 at 9:45 AM, Alexander V. Chernikov > wrote: > >> I suspect the reason here is link state bridge handling. >> ix0 does not seem to have IFCAP_LINKSTATE option but re(4) does. Probably >> wlan0 doesn't have LINKSTATE option. >> Code in bridge_linkcheck() doesn't handle the case with both "has link >> state" and "no link state" interfaces well: >> if reX is the only interface w/ IFCAP_LINKSTATE and it goes down, bridge >> will also change its link state to down. >> (However, bridge does not seem to have link state option itself, so >> RT_LINK_IS_UP() macro should return true...) >> >> >> >> > ​For validating your "IFCAP_LINKSTATE" hypothesis, I've plug an USB > ethernet adapter ue(4) that didn't support IFCAP_LINKSTATE. > And I've setup the bridge0 with wlan0 and ue0 (in place of re1): same bug > triggered. I need to ​plug a cable for correct routing. > > ​root@fbsd-router:~ # ifconfig bridge0 > bridge0: flags=8843 metric 0 mtu > 1500 > ether 02:6b:c0:de:b8:00 > inet 1.1.1.1 netmask 0xffffff00 broadcast 1.1.1.255 > nd6 options=9 > groups: bridge > id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15 > maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200 > root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0 > member: ue0 flags=143 > ifmaxaddr 0 port 7 priority 128 path cost 55 > member: wlan0 flags=143 > ifmaxaddr 0 port 5 priority 128 path cost 33333 > root@fbsd-router:~ # ifconfig ue0 > ue0: flags=8943 metric 0 > mtu 1500 > options=80008 > ether 00:19:fd:4e:77:4d > nd6 options=29 > media: Ethernet autoselect (none) > status: no carrier > ​ > ​Regards, > _______________________________________________ > freebsd-wireless@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-wireless > To unsubscribe, send any mail to "freebsd-wireless-unsubscribe@freebsd.org" IMHO, this situation happens because if_bridge applies link state logic with the (wrong) assumption that it is _only_ responsible to forward packets between member interfaces. In this special setup, the packet comes from IP layer (not from another member interface) and should be forwarded on an up and active member interface w/o problem. It seems to me that the correct behavior for if_bridge it to check link state after it has determined outgoing interface and is about to forward the packet on that interface (however, I am not sure if returning unreachables, which is a good troubleshooting signal, is then possible or not). -- Best regards Hooman Fazaeli