Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
Dnsmasq
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Dnsmasq
Commits
d9fb0be8
Commit
d9fb0be8
authored
Jul 25, 2013
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make --clear-on-reload apply to DBus API too.
parent
3f3adae6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
8 deletions
+21
-8
CHANGELOG
CHANGELOG
+3
-0
man/dnsmasq.8
man/dnsmasq.8
+2
-1
src/dbus.c
src/dbus.c
+16
-7
No files found.
CHANGELOG
View file @
d9fb0be8
...
@@ -68,6 +68,9 @@ version 2.67
...
@@ -68,6 +68,9 @@ version 2.67
name to request that a FQDN option is returned in the
name to request that a FQDN option is returned in the
reply. Thanks to Roy Marples for the patch.
reply. Thanks to Roy Marples for the patch.
Make --clear-on-reload apply to setting upstream servers
via DBus too.
version 2.66
version 2.66
Add the ability to act as an authoritative DNS
Add the ability to act as an authoritative DNS
...
...
man/dnsmasq.8
View file @
d9fb0be8
...
@@ -338,7 +338,8 @@ by '/', like the --server syntax, eg.
...
@@ -338,7 +338,8 @@ by '/', like the --server syntax, eg.
Don't poll /etc/resolv.conf for changes.
Don't poll /etc/resolv.conf for changes.
.TP
.TP
.B --clear-on-reload
.B --clear-on-reload
Whenever /etc/resolv.conf is re-read, clear the DNS cache.
Whenever /etc/resolv.conf is re-read or the upstream servers are set
via DBus, clear the DNS cache.
This is useful when new nameservers may have different
This is useful when new nameservers may have different
data than that held in cache.
data than that held in cache.
.TP
.TP
...
...
src/dbus.c
View file @
d9fb0be8
...
@@ -305,8 +305,6 @@ static DBusMessage* dbus_read_servers_ex(DBusMessage *message, int strings)
...
@@ -305,8 +305,6 @@ static DBusMessage* dbus_read_servers_ex(DBusMessage *message, int strings)
const
char
*
addr_err
;
const
char
*
addr_err
;
char
*
dup
=
NULL
;
char
*
dup
=
NULL
;
my_syslog
(
LOG_INFO
,
_
(
"setting upstream servers from DBus"
));
if
(
!
dbus_message_iter_init
(
message
,
&
iter
))
if
(
!
dbus_message_iter_init
(
message
,
&
iter
))
{
{
return
dbus_message_new_error
(
message
,
DBUS_ERROR_INVALID_ARGS
,
return
dbus_message_new_error
(
message
,
DBUS_ERROR_INVALID_ARGS
,
...
@@ -478,6 +476,7 @@ DBusHandlerResult message_handler(DBusConnection *connection,
...
@@ -478,6 +476,7 @@ DBusHandlerResult message_handler(DBusConnection *connection,
{
{
char
*
method
=
(
char
*
)
dbus_message_get_member
(
message
);
char
*
method
=
(
char
*
)
dbus_message_get_member
(
message
);
DBusMessage
*
reply
=
NULL
;
DBusMessage
*
reply
=
NULL
;
int
clear_cache
=
0
,
new_servers
=
0
;
if
(
dbus_message_is_method_call
(
message
,
DBUS_INTERFACE_INTROSPECTABLE
,
"Introspect"
))
if
(
dbus_message_is_method_call
(
message
,
DBUS_INTERFACE_INTROSPECTABLE
,
"Introspect"
))
{
{
...
@@ -501,24 +500,34 @@ DBusHandlerResult message_handler(DBusConnection *connection,
...
@@ -501,24 +500,34 @@ DBusHandlerResult message_handler(DBusConnection *connection,
}
}
else
if
(
strcmp
(
method
,
"SetServers"
)
==
0
)
else
if
(
strcmp
(
method
,
"SetServers"
)
==
0
)
{
{
my_syslog
(
LOG_INFO
,
_
(
"setting upstream servers from DBus"
));
dbus_read_servers
(
message
);
dbus_read_servers
(
message
);
check_servers
()
;
new_servers
=
1
;
}
}
else
if
(
strcmp
(
method
,
"SetServersEx"
)
==
0
)
else
if
(
strcmp
(
method
,
"SetServersEx"
)
==
0
)
{
{
reply
=
dbus_read_servers_ex
(
message
,
0
);
reply
=
dbus_read_servers_ex
(
message
,
0
);
check_servers
()
;
new_servers
=
1
;
}
}
else
if
(
strcmp
(
method
,
"SetDomainServers"
)
==
0
)
else
if
(
strcmp
(
method
,
"SetDomainServers"
)
==
0
)
{
{
reply
=
dbus_read_servers_ex
(
message
,
1
);
reply
=
dbus_read_servers_ex
(
message
,
1
);
check_servers
()
;
new_servers
=
1
;
}
}
else
if
(
strcmp
(
method
,
"ClearCache"
)
==
0
)
else
if
(
strcmp
(
method
,
"ClearCache"
)
==
0
)
clear_cache
_and_reload
(
dnsmasq_time
())
;
clear_cache
=
1
;
else
else
return
(
DBUS_HANDLER_RESULT_NOT_YET_HANDLED
);
return
(
DBUS_HANDLER_RESULT_NOT_YET_HANDLED
);
if
(
new_servers
)
{
my_syslog
(
LOG_INFO
,
_
(
"setting upstream servers from DBus"
));
check_servers
();
if
(
option_bool
(
OPT_RELOAD
))
clear_cache
=
1
;
}
if
(
clear_cache
)
clear_cache_and_reload
(
dnsmasq_time
());
method
=
user_data
;
/* no warning */
method
=
user_data
;
/* no warning */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment