[Bug 258845] iflib: error from IFDI_PROMISC_SET() not handled

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 01 Oct 2021 13:44:09 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258845

            Bug ID: 258845
           Summary: iflib: error from IFDI_PROMISC_SET() not handled
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: emaste@freebsd.org

iflib_if_ioctl has:

  4360          case SIOCSIFFLAGS:
  4361                  CTX_LOCK(ctx);
  4362                  if (if_getflags(ifp) & IFF_UP) {
  4363                          if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
  4364                                  if ((if_getflags(ifp) ^
ctx->ifc_if_flags) &
  4365                                      (IFF_PROMISC | IFF_ALLMULTI)) {
  4366                                          CTX_UNLOCK(ctx);
  4367                                          err = IFDI_PROMISC_SET(ctx,
if_getflags(ifp));
  4368                                          CTX_LOCK(ctx);
  4369                                  }
  4370                          } else
  4371                                  reinit = 1;
  4372                  } else if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
  4373                          iflib_stop(ctx);
  4374                  }
  4375                  ctx->ifc_if_flags = if_getflags(ifp);
  4376                  CTX_UNLOCK(ctx);
  4377                  break;

Note that ctx->ifc_if_flags is set regardless of error return from
IFDI_PROMISC_SET(). Assume that IFDI_PROMISC_SET() fails for some reason. A
subsequent SIOCSIFFLAGS call to set promisc or allmulti should result in
another  IFDI_PROMISC_SET() call but will be skipped due to the comparison at
line 4364.

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