Commit 49752b90 authored by Wang Jian's avatar Wang Jian Committed by Simon Kelley

Log IPSET actions.

parent e98bd52e
...@@ -1609,6 +1609,13 @@ void log_query(unsigned int flags, char *name, struct all_addr *addr, char *arg) ...@@ -1609,6 +1609,13 @@ void log_query(unsigned int flags, char *name, struct all_addr *addr, char *arg)
source = arg; source = arg;
verb = "to"; verb = "to";
} }
else if (flags & F_IPSET)
{
source = "ipset add";
dest = name;
name = arg;
verb = daemon->addrbuff;
}
else else
source = "cached"; source = "cached";
......
...@@ -436,6 +436,7 @@ struct crec { ...@@ -436,6 +436,7 @@ struct crec {
#define F_KEYTAG (1u<<23) #define F_KEYTAG (1u<<23)
#define F_SECSTAT (1u<<24) #define F_SECSTAT (1u<<24)
#define F_NO_RR (1u<<25) #define F_NO_RR (1u<<25)
#define F_IPSET (1u<<26)
/* Values of uid in crecs with F_CONFIG bit set. */ /* Values of uid in crecs with F_CONFIG bit set. */
#define SRC_INTERFACE 0 #define SRC_INTERFACE 0
......
...@@ -1102,7 +1102,10 @@ int extract_addresses(struct dns_header *header, size_t qlen, char *name, time_t ...@@ -1102,7 +1102,10 @@ int extract_addresses(struct dns_header *header, size_t qlen, char *name, time_t
{ {
ipsets_cur = ipsets; ipsets_cur = ipsets;
while (*ipsets_cur) while (*ipsets_cur)
add_to_ipset(*ipsets_cur++, &addr, flags, 0); {
log_query(F_IPSET, name, &addr, *ipsets_cur);
add_to_ipset(*ipsets_cur++, &addr, flags, 0);
}
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment