dccp_shutdown_client(sc);
}
+static void dccp_shutdown(void)
+{
+ dccp_shutdown_clients();
+ generic_acl_deplete(&dss->acl);
+}
+
/** * Obtain current MPS according to RFC 4340, sec. 14. */
static int dccp_init_fec(struct sender_client *sc)
{
const struct sender dccp_sender = {
.name = "dccp",
.init = dccp_send_init,
- .shutdown = dccp_shutdown_clients,
+ .shutdown = dccp_shutdown,
.pre_select = dccp_pre_select,
.post_select = dccp_post_select,
.shutdown_clients = dccp_shutdown_clients,
shutdown_clients(hss);
}
+static void http_shutdown(void)
+{
+ http_shutdown_clients();
+ generic_acl_deplete(&hss->acl);
+}
+
static int queue_chunk_or_shutdown(struct sender_client *sc,
struct sender_status *ss, const char *buf, size_t num_bytes)
{
const struct sender http_sender = {
.name = "http",
.init = http_send_init,
- .shutdown = http_shutdown_clients,
+ .shutdown = http_shutdown,
.pre_select = http_pre_select,
.post_select = http_post_select,
.send = http_send,
struct sender_status *ss);
void generic_com_deny(struct sender_command_data *scd,
struct sender_status *ss);
+void generic_acl_deplete(struct list_head *acl);
int generic_com_on(struct sender_status *ss, unsigned protocol);
void generic_com_off(struct sender_status *ss);
char *generic_sender_help(void);
acl_allow(scd->host, scd->netmask, &ss->acl, ss->default_deny);
}
+/**
+ * Empty the access control list of a sender.
+ *
+ * \param acl The access control list of the sender.
+ *
+ * This is called from the ->shutdown methods of the http and the dccp sender.
+ */
+void generic_acl_deplete(struct list_head *acl)
+{
+ /*
+ * Since default_deny is false, the ACL is considered a blacklist. A
+ * netmask of zero matches any IP address, so this call empties the ACL.
+ */
+ acl_allow("0.0.0.0", 0 /* netmask */, acl, 0 /* default_deny */);
+}
+
/**
* Deny connections from the given range of IP addresses.
*