* Locks or unlocks given table */
| 588 | * Locks or unlocks given table |
| 589 | */ |
| 590 | static void |
| 591 | table_lock(ipfw_obj_header *oh, int lock) |
| 592 | { |
| 593 | ipfw_xtable_info xi; |
| 594 | |
| 595 | memset(&xi, 0, sizeof(xi)); |
| 596 | |
| 597 | xi.mflags |= IPFW_TMFLAGS_LOCK; |
| 598 | xi.flags |= (lock != 0) ? IPFW_TGFLAGS_LOCKED : 0; |
| 599 | |
| 600 | if (table_do_modify(oh, &xi) != 0) |
| 601 | err(EX_OSERR, "Table %s failed", lock != 0 ? "lock" : "unlock"); |
| 602 | } |
| 603 | |
| 604 | /* |
| 605 | * Destroys given table specified by @oh->ntlv. |
no test coverage detected