Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 May 2018 10:50:52 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r333400 - head/sys/net
Message-ID:  <201805091050.w49Aoqqg071398@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805091050.w49Aoqqg071398>