static bool rm(__u32 addr, __u8 prefix_len, __u16 min, __u16 max) { struct ipv4_range range; range.prefix.address.s_addr = cpu_to_be32(addr); range.prefix.len = prefix_len; range.ports.min = min; range.ports.max = max; return ASSERT_INT(0, pool4db_rm(pool, 1, L4PROTO_TCP, &range), "rm of %pI4/%u (%u-%u)", &range.prefix.address, prefix_len, min, max); }
static int handle_pool4_rm(struct nlmsghdr *nl_hdr, union request_pool4 *request) { int error; if (verify_superpriv()) return respond_error(nl_hdr, -EPERM); log_debug("Removing elements from the IPv4 pool."); error = pool4db_rm(request->rm.mark, request->rm.proto, &request->rm.addrs, &request->rm.ports); if (xlat_is_nat64() && !request->rm.quick) { sessiondb_delete_taddr4s(&request->rm.addrs, &request->rm.ports); bibdb_delete_taddr4s(&request->rm.addrs, &request->rm.ports); } return respond_error(nl_hdr, error); }