Though following code sequence is safe currently (even w/o BGL):
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 9 Aug 2008 07:08:20 +0000 (07:08 +0000)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 9 Aug 2008 07:08:20 +0000 (07:08 +0000)
commit3d89751f61380fd01b5cbab809d4daf714958ad7
tree748e845e4a65d16ed0bcc95b24cdc8fbf1a26394
parentd7e278bb4b129ccc61cde6eaddc1397a336fda3c
Though following code sequence is safe currently (even w/o BGL):
  if (ipfw_dyn_v != NULL) {
    lockmgr(&dyn_lock, LK_...);
    /* accessing ipfw_dyn_v */
    lockmgr(&dyn_lock, LK_RELEASE)
  }

it will be better for us to guard against future code changes by using:
  if (ipfw_dyn_v != NULL) {
    lockmgr(&dyn_lock, LK_...);
    if (ipfw_dyn_v != NULL) {
      /* accessing ipfw_dyn_v */
    }
    lockmgr(&dyn_lock, LK_RELEASE)
  }
sys/net/ipfw/ip_fw2.c