Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Feb 2019 15:27:49 +0000
From:      bugzilla-noreply@freebsd.org
To:        net@FreeBSD.org
Subject:   [Bug 235704] [net] [patch] tun(4) can't be destroyed on a VNET jail if it's renamed
Message-ID:  <bug-235704-7501-CQpMi6wWbn@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-235704-7501@https.bugs.freebsd.org/bugzilla/>
References:  <bug-235704-7501@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D235704

--- Comment #9 from genneko217@gmail.com ---
Sorry to bother you again and again, but let me ask one more thing.

Because some interface types (tap, vxlan etc.) still don't have
virtualized cloners, I think similar problems could occur to them.
(I know this is truly a corner case, though.)=20

if_clone_destroy() in sys/net/if_clone.c has the following code to
find the cloner for an interface to destroy.

What I was wondering is why the line 263-267 (the first loop) and
the line 271-278 (the second loop) use different code.
Can't they be the same?
(My original patch came from this question.)

   261          /* Find the cloner for this interface */
   262          IF_CLONERS_LOCK();
   263          LIST_FOREACH(ifc, &V_if_cloners, ifc_list) {
-> 264                  if (strcmp(ifc->ifc_name, ifp->if_dname) =3D=3D 0) {
   265                          break;
   266                  }
   267          }
   268  #ifdef VIMAGE
   269          if (ifc =3D=3D NULL && !IS_DEFAULT_VNET(curvnet)) {
   270                  CURVNET_SET_QUIET(vnet0);
   271                  LIST_FOREACH(ifc, &V_if_cloners, ifc_list)
   272                          if (ifc->ifc_type =3D=3D SIMPLE) {
-> 273                                  if (ifc_simple_match(ifc, name))
   274                                          break;
   275                          } else {
-> 276                                  if (ifc->ifc_match(ifc, name))
   277                                          break;
   278                          }
   279                  CURVNET_RESTORE();
   280          }
   281  #endif

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-235704-7501-CQpMi6wWbn>