Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion conf/functions.in
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ writeconfig() {
[ "$HS_DOMAINDNSLOCAL" = "on" ] && addconfig2 "domaindnslocal"
[ "$HS_SESKEEPALIVE" = "on" ] && addconfig2 "seskeepalive"
[ "$HS_RADSEC" = "on" ] && addconfig2 "radsec"
[ -n "$HS_DNSLOG" ] && addconfig2 "dnslog \"$HS_DNSLOG\""
[ -n "$HS_USESTATUSFILE" ] && addconfig2 "usestatusfile \"$HS_USESTATUSFILE\""
[ -n "$HS_UAMLOGOUTIP" ] && addconfig2 "uamlogoutip \"$HS_UAMLOGOUTIP\""
[ -n "$HS_UAMALIASIP" ] && addconfig2 "uamaliasip \"$HS_UAMALIASIP\""
Expand Down
7 changes: 0 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,6 @@ if test x"$enable_proxyvsa" = xyes; then
AC_DEFINE(ENABLE_PROXYVSA,1,[Define to enable VSA proxy])
fi

AC_ARG_ENABLE(dnslog, [AS_HELP_STRING([--enable-dnslog],[Enable support to log DNS name queries])],
enable_dnslog=$enableval, enable_dnslog=no)

if test x"$enable_dnslog" = xyes; then
AC_DEFINE(ENABLE_DNSLOG,1,[Define to logging of DNS requests])
fi

AC_ARG_ENABLE(ipwhitelist, [AS_HELP_STRING([--enable-ipwhitelist],[Enable file based IP white list])],
enable_ipwhitelist=$enableval, enable_ipwhitelist=no)

Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ config.status: configure
--sysconfdir=/etc --localstatedir=/var --enable-largelimits \
--enable-proxyvsa --enable-miniportal --enable-chilliredir \
--enable-chilliproxy --enable-binstatusfile --enable-chilliscript \
--enable-chilliradsec --enable-dnslog --enable-layer3 --enable-eapol \
--enable-chilliradsec --enable-layer3 --enable-eapol \
--enable-uamdomainfile --enable-redirdnsreq --enable-modules \
--enable-multiroute --enable-extadmvsa --with-openssl --with-poll \
--enable-json --enable-libjson
Expand Down
1 change: 0 additions & 1 deletion src/cmdline.ggo
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ option "natport" - "Port to use when oding nat on the WAN (routeidx)" int defa
option "redirssl" - "Enable redirection of SSL/HTTP port (requires SSL support)" flag off
option "uamuissl" - "Enable SSL/HTTPS support on the uamuiport" flag off

option "dnslog" - "Log DNS requests to a file." string no
option "ipwhitelist" - "Binary IP White List file" string no
option "uamdomainfile" - "Load uamdomains (regex) from file" string no

Expand Down
32 changes: 1 addition & 31 deletions src/dhcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1703,7 +1703,7 @@ int dhcp_dns(struct dhcp_conn_t *conn, uint8_t *pack,

} else {

#if defined(ENABLE_DNSLOG) || defined(ENABLE_MODULES)
#if defined(ENABLE_MODULES)
struct app_conn_t *appconn = dhcp_get_appconn_pkt(conn, pkt_iphdr(pack), !isReq);
#endif
struct dns_packet_t *dnsp = pkt_dnspkt(pack);
Expand Down Expand Up @@ -2035,36 +2035,6 @@ int dhcp_dns(struct dhcp_conn_t *conn, uint8_t *pack,
}
}

#ifdef ENABLE_DNSLOG
if (isReq && _options.dnslog) {
int fd = open(_options.dnslog, O_WRONLY|O_APPEND|O_CREAT, 0666);
if (fd > 0) {
char line[512];
char *username = 0;
int authenticated = 0;

if (appconn) {
username = appconn->s_state.redir.username;
authenticated = appconn->s_state.authenticated;
}

snprintf(line, sizeof(line),
"%d,"MAC_FMT",%s,%s,%d,%s\n",
(int)time(0),
MAC_ARG(conn->hismac),
inet_ntoa(conn->hisip),
q, authenticated,
username ? username : "");

safe_write(fd, line, strlen(line));
close(fd);
} else {
syslog(LOG_ERR, "%s: could not open log file %s",
strerror(errno), _options.dnslog);
}
}
#endif

#ifdef ENABLE_IPV6
if (_options.ipv6 && mod > 0 && !isReq && an_mark && ancount > 0) {
/* repack as IPv6 AAAA addresses */
Expand Down
10 changes: 0 additions & 10 deletions src/main-opt.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ static const char *compile_options = "Compiled with "
#ifdef ENABLE_DHCPOPT
"ENABLE_DHCPOPT "
#endif
#ifdef ENABLE_DNSLOG
"ENABLE_DNSLOG "
#endif
#ifdef ENABLE_UAMDOMAINFILE
"ENABLE_UAMDOMAINFILE "
#endif
Expand Down Expand Up @@ -1274,13 +1271,6 @@ int main(int argc, char **argv) {
_options.kname = STRDUP(args_info.kname_arg);
#endif

#ifdef ENABLE_DNSLOG
_options.dnslog = STRDUP(args_info.dnslog_arg);
#else
if (args_info.dnslog_arg)
syslog(LOG_ERR, "option dnslog given when no support built-in");
#endif

#ifdef ENABLE_IPWHITELIST
_options.ipwhitelist = STRDUP(args_info.ipwhitelist_arg);
#else
Expand Down
6 changes: 0 additions & 6 deletions src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,6 @@ int options_fromfd(int fd, bstring bt) {
#ifdef HAVE_NETFILTER_COOVA
if (!option_s_l(bt, &o.kname)) return 0;
#endif
#ifdef ENABLE_DNSLOG
if (!option_s_l(bt, &o.dnslog)) return 0;
#endif
#ifdef ENABLE_IPWHITELIST
if (!option_s_l(bt, &o.ipwhitelist)) return 0;
#endif
Expand Down Expand Up @@ -540,9 +537,6 @@ int options_save(char *file, bstring bt) {
#ifdef HAVE_NETFILTER_COOVA
if (!option_s_s(bt, &o.kname)) return 0;
#endif
#ifdef ENABLE_DNSLOG
if (!option_s_s(bt, &o.dnslog)) return 0;
#endif
#ifdef ENABLE_IPWHITELIST
if (!option_s_s(bt, &o.ipwhitelist)) return 0;
#endif
Expand Down
4 changes: 0 additions & 4 deletions src/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,6 @@ struct options_t {
int dhcp_options_len;
#endif

#ifdef ENABLE_DNSLOG
char *dnslog;
#endif

#ifdef ENABLE_IPWHITELIST
char *ipwhitelist;
#endif
Expand Down