| 646 | } |
| 647 | |
| 648 | static int |
| 649 | table_do_swap(ipfw_obj_header *oh, char *second) |
| 650 | { |
| 651 | char tbuf[sizeof(ipfw_obj_header) + sizeof(ipfw_obj_ntlv)]; |
| 652 | int error; |
| 653 | |
| 654 | memset(tbuf, 0, sizeof(tbuf)); |
| 655 | memcpy(tbuf, oh, sizeof(*oh)); |
| 656 | oh = (ipfw_obj_header *)tbuf; |
| 657 | table_fill_ntlv((ipfw_obj_ntlv *)(oh + 1), second, oh->ntlv.set, 1); |
| 658 | |
| 659 | error = do_set3(IP_FW_TABLE_XSWAP, &oh->opheader, sizeof(tbuf)); |
| 660 | |
| 661 | return (error); |
| 662 | } |
| 663 | |
| 664 | /* |
| 665 | * Swaps given table with @second one. |
no test coverage detected