From owner-svn-src-head@freebsd.org Wed May 9 10:50:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB7F2FB3164; Wed, 9 May 2018 10:50:52 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F0847D319; Wed, 9 May 2018 10:50:52 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4035F106B8; Wed, 9 May 2018 10:50:52 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w49AoqCO071399; Wed, 9 May 2018 10:50:52 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w49Aoqqg071398; Wed, 9 May 2018 10:50:52 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201805091050.w49Aoqqg071398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 9 May 2018 10:50:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333400 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 333400 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 May 2018 10:50:52 -0000 Author: ae Date: Wed May 9 10:50:51 2018 New Revision: 333400 URL: https://svnweb.freebsd.org/changeset/base/333400 Log: Add IFCAP_LINKSTATE support to if_loop(4). Reviewed by: wollman Obtained from: Yandex LLC MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D15278 Modified: head/sys/net/if_loop.c Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Wed May 9 10:33:25 2018 (r333399) +++ head/sys/net/if_loop.c Wed May 9 10:50:51 2018 (r333400) @@ -136,7 +136,7 @@ lo_clone_create(struct if_clone *ifc, int unit, caddr_ ifp->if_output = looutput; ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_capabilities = ifp->if_capenable = - IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6; + IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 | IFCAP_LINKSTATE; ifp->if_hwassist = LO_CSUM_FEATURES | LO_CSUM_FEATURES6; if_attach(ifp); bpfattach(ifp, DLT_NULL, sizeof(u_int32_t)); @@ -413,6 +413,8 @@ loioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; case SIOCSIFFLAGS: + if_link_state_change(ifp, (ifp->if_flags & IFF_UP) ? + LINK_STATE_UP: LINK_STATE_DOWN); break; case SIOCSIFCAP: