Remove a hole in a firewall associated with a particular alias lnk. Calling this too often is harmless. */
| 2758 | /* Remove a hole in a firewall associated with a particular alias |
| 2759 | lnk. Calling this too often is harmless. */ |
| 2760 | static void |
| 2761 | ClearFWHole(struct alias_link *lnk) |
| 2762 | { |
| 2763 | struct libalias *la; |
| 2764 | |
| 2765 | la = lnk->la; |
| 2766 | if (lnk->link_type == LINK_TCP) { |
| 2767 | int fwhole = lnk->data.tcp->fwhole; /* Where is the firewall |
| 2768 | * hole? */ |
| 2769 | struct ip_fw rule; |
| 2770 | |
| 2771 | if (fwhole < 0) |
| 2772 | return; |
| 2773 | |
| 2774 | memset(&rule, 0, sizeof rule); /* useless for ipfw2 */ |
| 2775 | while (!setsockopt(la->fireWallFD, IPPROTO_IP, IP_FW_DEL, |
| 2776 | &fwhole, sizeof fwhole)); |
| 2777 | fw_clrfield(la, la->fireWallField, fwhole); |
| 2778 | lnk->data.tcp->fwhole = -1; |
| 2779 | } |
| 2780 | } |
| 2781 | |
| 2782 | /* Clear out the entire range dedicated to firewall holes. */ |
| 2783 | static void |
no test coverage detected