From owner-freebsd-current@freebsd.org Wed Jun 21 17:48:21 2017 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 1467AD94D7F for ; Wed, 21 Jun 2017 17:48:21 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qt0-x232.google.com (mail-qt0-x232.google.com [IPv6:2607:f8b0:400d:c0d::232]) (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 BDED675C24 for ; Wed, 21 Jun 2017 17:48:20 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qt0-x232.google.com with SMTP id v20so47187597qtg.1 for ; Wed, 21 Jun 2017 10:48:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:subject:to:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=TrX4CUkyVGuKIluGQIVioO+9GuRJP5Cfl//fzn47Efk=; b=mNClDXhL2aeNOHbo/dUMdV7Z96Acwh/071nwiteRsPO5VTpPlNWePzFaP9l8zzxauy 5NmRREed3ZVN6b9IQ8B4pJt00ks37r6F2ZcJWZ4gvK87T4I92r6xMxwXV7TCcZDYaB02 HV21dNoi3EO6zEx4sotQIyiJVDinwr0FMslKHpcAwXB/x86DrePjadJe9hLJi9nggJYQ rZ4IidJsedvZx9oWPIs1stfyDc2fSagAxF9m+xrOy+4lOMGl9FKGFX0AOL4bLAzIHS5T sUT9IM2yoXWO906rRj75+MqhCWcmp7pKFc9O9CeDsXfq/jKUdRtYNawPPYvoESdZNn86 l6gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:subject:to:message-id:date :user-agent:mime-version:content-language:content-transfer-encoding; bh=TrX4CUkyVGuKIluGQIVioO+9GuRJP5Cfl//fzn47Efk=; b=K07kfie3nXDdxRRevtgUYpK48KKt6NeMl4z1oSYEBmfdPGYX1Uhh5i148EFZXMPhI1 yLEat6GPMSmv/erCy7LdLBa5uJXbqWzm/FzPFZquZVP+MPDvJy6Smh+C2d42IpWKUNdE 0CgBBxV6mB2VKEZQar33agJxDfGxo5nwqD8EjLZjNj9v0JzAkMmzo0o8elxeG3V6cNMH I58GPjSXEneErKTmHoZ807Iquicnhqv4uVjWcdekJT4+MzP1NqQoIn4LmFYseld+4sd2 AhChE/d66JRPid1pU2pHcQM9dY9gNJmR/pvq43ZphM8cbu5uamc+st9/CLcVWP03zYPK ATkA== X-Gm-Message-State: AKS2vOxUs+IgpwxghIkev8BAezWwprjGxzaE3/bcCjinc/T66GalCPYF IaRmOkNZs0DkUnvMa2w= X-Received: by 10.200.55.65 with SMTP id p1mr4112498qtb.64.1498067299554; Wed, 21 Jun 2017 10:48:19 -0700 (PDT) Received: from mbp-eth.home ([177.53.86.172]) by smtp.gmail.com with ESMTPSA id o3sm12085010qtf.28.2017.06.21.10.48.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Jun 2017 10:48:18 -0700 (PDT) Sender: Renato Botelho From: Renato Botelho Subject: Failover Mode Between Ethernet and Wireless Interfaces broken on >= 11 To: freebsd-current@freebsd.org Message-ID: <1c1e5c6f-35e5-ca14-2e23-5e33d86a5266@FreeBSD.org> Date: Wed, 21 Jun 2017 14:48:16 -0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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, 21 Jun 2017 17:48:21 -0000 I've already sent it to net, but I suspect this is the appropriate place to discuss this subject. Last night I was configuring a new laptop and decided to give it [1] a try. I figured out this section of handbook (similar instructions are on lagg(4) manpage) is outdated, based on FreeBSD 10.x. Then I modified a bit the commands and tried to get it configured on 12-CURRENT, without success. I spoke with adrian@, who told me this setup doesn't work on FreeBSD > 10, because on newer versions Wireless interfaces mac address cannot be changed. My next attempt was to do the other way round and make lagg to use wlan0 mac address instead of em0's. but even doing this my wireless interface ended up not working. After further investigation I noted that a simple command: # ifconfig wlan0 ether $wlan0_current_mac_address is enough to break it on 12-CURRENT. I've checked if_setlladdr() source code and noted it always replace the mac address, even if the same is already configured on the interface. Is it the expected behavior? Just as a PoC I've applied the following patch to if_setlladdr(): Index: sys/net/if.c =================================================================== --- sys/net/if.c (revision 320097) +++ sys/net/if.c (working copy) @@ -3519,6 +3519,10 @@ ifa_free(ifa); return (EINVAL); } + if (memcmp(lladdr, LLADDR(sdl), len) == 0) { + ifa_free(ifa); + return (0); + } switch (ifp->if_type) { case IFT_ETHER: case IFT_FDDI: And configured it to use wlan0 mac address on rc.conf: ifconfig_em0="ether 60:67:20:c5:2d:48 up" wlans_iwn0="wlan0" ifconfig_wlan0="WPA" cloned_interfaces="lagg0" ifconfig_lagg0="up laggproto failover laggport em0 laggport wlan0 DHCP" and it's now working as expected. Other than that, I believe if wlan interfaces cannot have their mac address changed, ifconfig should return an error when user attempts to do it, and if_setlladdr() should do the same. Thoughts? [1] https://www.freebsd.org/doc/handbook/network-aggregation.html#networking-lagg-wired-and-wireless -- Renato Botelho