mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
import of dnsmasq-2.41.tar.gz
This commit is contained in:
22
src/dbus.c
22
src/dbus.c
@@ -1,13 +1,17 @@
|
||||
/* dnsmasq is Copyright (c) 2000-2005 Simon Kelley
|
||||
/* dnsmasq is Copyright (c) 2000-2007 Simon Kelley
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 dated June, 1991.
|
||||
|
||||
the Free Software Foundation; version 2 dated June, 1991, or
|
||||
(at your option) version 3 dated 29 June, 2007.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "dnsmasq.h"
|
||||
@@ -112,9 +116,9 @@ static void dbus_read_servers(DBusMessage *message)
|
||||
#else
|
||||
if (i == sizeof(struct in6_addr)-1)
|
||||
{
|
||||
memcpy(&addr.in6.sin6_addr, p, sizeof(addr.in6));
|
||||
memcpy(&addr.in6.sin6_addr, p, sizeof(struct in6_addr));
|
||||
#ifdef HAVE_SOCKADDR_SA_LEN
|
||||
source_addr.in6.sin6_len = addr.in6.sin6_len = sizeof(addr.in6);
|
||||
source_addr.in6.sin6_len = addr.in6.sin6_len = sizeof(stuct sockaddr_in6);
|
||||
#endif
|
||||
source_addr.in6.sin6_family = addr.in6.sin6_family = AF_INET6;
|
||||
addr.in6.sin6_port = htons(NAMESERVER_PORT);
|
||||
@@ -292,7 +296,11 @@ void set_dbus_listeners(int *maxfdp,
|
||||
if (dbus_watch_get_enabled(w->watch))
|
||||
{
|
||||
unsigned int flags = dbus_watch_get_flags(w->watch);
|
||||
#if (DBUS_MINOR > 0)
|
||||
int fd = dbus_watch_get_unix_fd(w->watch);
|
||||
#else
|
||||
int fd = dbus_watch_get_fd(w->watch);
|
||||
#endif
|
||||
|
||||
bump_maxfd(fd, maxfdp);
|
||||
|
||||
@@ -315,7 +323,11 @@ void check_dbus_listeners(fd_set *rset, fd_set *wset, fd_set *eset)
|
||||
if (dbus_watch_get_enabled(w->watch))
|
||||
{
|
||||
unsigned int flags = 0;
|
||||
#if (DBUS_MINOR > 0)
|
||||
int fd = dbus_watch_get_unix_fd(w->watch);
|
||||
#else
|
||||
int fd = dbus_watch_get_fd(w->watch);
|
||||
#endif
|
||||
|
||||
if (FD_ISSET(fd, rset))
|
||||
flags |= DBUS_WATCH_READABLE;
|
||||
|
||||
Reference in New Issue
Block a user