Compare commits

..
13 Commits
23 changed files with 2955 additions and 2660 deletions

No files matched your search

+21 -9
View File
@@ -45,18 +45,25 @@ version 2.60
round-robin to multiple servers, in the same way as round-robin to multiple servers, in the same way as
--dhcp-boot. A good suggestion from Cristiano Cumer. --dhcp-boot. A good suggestion from Cristiano Cumer.
Support BUILDDIR variable in the Makefile. Allows Support BUILDDIR variable in the Makefile. Allows builds
builds from multiple architectures in the same tree with eg for multiple archs from the same source tree with eg.
make BUILDDIR=linux make BUILDDIR=linux (relative to dnsmasq tree)
make BUILDDIR=/tmp/openbsd (absolute path)
If BUILDDIR is not set, compilation happens in the src If BUILDDIR is not set, compilation happens in the src
directory, as before. Suggestion from Mark Mitchell. directory, as before. Suggestion from Mark Mitchell.
First cut at supporting DHCPv6. Support is pretty much Support DHCPv6. Support is there for the sort of things
there for the sort of things the existing v4 server does, the existing v4 server does, including tags, options,
including tags, options, static addresses and relay static addresses and relay support. Missing is prefix
support. Missing is prefix delegation. This is lightly delegation, which is probably not required in the dnsmasq
tested alpha code, it is NOT YET PRODUCTION READY. Test niche, and an easy way to accept prefix delegations from
reports would be greatly valued. an upstream DHCPv6 server, which is. Future plans include
support for DHCPv6 router option and MAC address option
(to make selecting clients by MAC address work like IPv4).
These will be added as the standards mature.
This code has been tested, but this is the first release,
so don't bet the farm on it just yet. Many thanks to all
testers who have got it this far.
Support IPv6 router advertisements. This is a Support IPv6 router advertisements. This is a
simple-minded implementation, aimed at providing the simple-minded implementation, aimed at providing the
@@ -64,6 +71,11 @@ version 2.60
configuration from the DHCPv6 conf, and should just need configuration from the DHCPv6 conf, and should just need
enabling with --enable-ra. enabling with --enable-ra.
Fix long-standing wrinkle with --localise-queries that
could result in wrong answers when DNS packets arrive
via an interface other than the expected one. Thanks to
Lorenzo Milesi and John Hanks for spotting this one.
version 2.59 version 2.59
Fix regression in 2.58 which caused failure to start up Fix regression in 2.58 which caused failure to start up
+66 -49
View File
@@ -13,52 +13,69 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
PREFIX = /usr/local # NOTE: Building the i18n targets requires GNU-make
BINDIR = ${PREFIX}/sbin
MANDIR = ${PREFIX}/share/man
LOCALEDIR = ${PREFIX}/share/locale
BUILDDIR = $(SRC)
CFLAGS = -Wall -W -O2 # Variables you may well want to override.
PREFIX = /usr/local
BINDIR = $(PREFIX)/sbin
MANDIR = $(PREFIX)/share/man
LOCALEDIR = $(PREFIX)/share/locale
BUILDDIR = $(SRC)
DESTDIR =
CFLAGS = -Wall -W -O2
LDFLAGS =
COPTS =
RPM_OPT_FLAGS =
LIBS =
################################################################# #################################################################
# Variables you might want to override.
PKG_CONFIG = pkg-config PKG_CONFIG = pkg-config
INSTALL = install INSTALL = install
MSGMERGE = msgmerge MSGMERGE = msgmerge
MSGFMT = msgfmt MSGFMT = msgfmt
XGETTEXT = xgettext XGETTEXT = xgettext
SRC = src SRC = src
PO = po PO = po
MAN = man MAN = man
DBUS_CFLAGS=`echo $(COPTS) | ../bld/pkg-wrapper HAVE_DBUS $(PKG_CONFIG) --cflags dbus-1` #################################################################
DBUS_LIBS= `echo $(COPTS) | ../bld/pkg-wrapper HAVE_DBUS $(PKG_CONFIG) --libs dbus-1`
IDN_CFLAGS= `echo $(COPTS) | ../bld/pkg-wrapper HAVE_IDN $(PKG_CONFIG) --cflags libidn`
IDN_LIBS= `echo $(COPTS) | ../bld/pkg-wrapper HAVE_IDN $(PKG_CONFIG) --libs libidn`
CT_CFLAGS= `echo $(COPTS) | ../bld/pkg-wrapper HAVE_CONNTRACK $(PKG_CONFIG) --cflags libnetfilter_conntrack`
CT_LIBS= `echo $(COPTS) | ../bld/pkg-wrapper HAVE_CONNTRACK $(PKG_CONFIG) --libs libnetfilter_conntrack`
LUA_CFLAGS= `echo $(COPTS) | ../bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --cflags lua5.1`
LUA_LIBS= `echo $(COPTS) | ../bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --libs lua5.1`
SUNOS_LIBS= `if uname | grep SunOS 2>&1 >/dev/null; then echo -lsocket -lnsl -lposix4; fi`
VERSION= -DVERSION='\"`../bld/get-version`\"'
OBJS = cache.o rfc1035.o util.o option.o forward.o network.o \ # pmake way. (NB no spaces to keep gmake 3.82 happy)
top!=pwd
# GNU make way.
top?=$(CURDIR)
dbus_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DBUS $(PKG_CONFIG) --cflags dbus-1`
dbus_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DBUS $(PKG_CONFIG) --libs dbus-1`
idn_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_IDN $(PKG_CONFIG) --cflags libidn`
idn_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_IDN $(PKG_CONFIG) --libs libidn`
ct_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_CONNTRACK $(PKG_CONFIG) --cflags libnetfilter_conntrack`
ct_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_CONNTRACK $(PKG_CONFIG) --libs libnetfilter_conntrack`
lua_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --cflags lua5.1`
lua_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --libs lua5.1`
sunos_libs = `if uname | grep SunOS >/dev/null 2>&1; then echo -lsocket -lnsl -lposix4; fi`
version = -DVERSION='\"`$(top)/bld/get-version $(top)`\"'
objs = cache.o rfc1035.o util.o option.o forward.o network.o \
dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o \ dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o \
helper.o tftp.o log.o conntrack.o dhcp6.o rfc3315.o \ helper.o tftp.o log.o conntrack.o dhcp6.o rfc3315.o \
dhcp-common.o outpacket.o radv.o dhcp-common.o outpacket.o radv.o
HDRS = dnsmasq.h config.h dhcp-protocol.h dhcp6-protocol.h \ hdrs = dnsmasq.h config.h dhcp-protocol.h dhcp6-protocol.h \
dns-protocol.h radv-protocol.h dns-protocol.h radv-protocol.h
all : $(BUILDDIR) all : $(BUILDDIR)
@cd $(BUILDDIR) && $(MAKE) \ @cd $(BUILDDIR) && $(MAKE) \
BUILD_CFLAGS="$(VERSION) $(DBUS_CFLAGS) $(IDN_CFLAGS) $(CT_CFLAGS) $(LUA_CFLAGS)" \ top="$(top)" \
BUILD_LIBS="$(DBUS_LIBS) $(IDN_LIBS) $(CT_LIBS) $(LUA_LIBS) $(SUNOS_LIBS)" \ build_cflags="$(version) $(dbus_cflags) $(idn_cflags) $(ct_cflags) $(lua_cflags)" \
-f ../Makefile dnsmasq build_libs="$(dbus_libs) $(idn_libs) $(ct_libs) $(lua_libs) $(sunos_libs)" \
-f $(top)/Makefile dnsmasq
clean : clean :
rm -f *~ $(BUILDDIR)/*.mo contrib/*/*~ */*~ $(BUILDDIR)/*.pot rm -f *~ $(BUILDDIR)/*.mo contrib/*/*~ */*~ $(BUILDDIR)/*.pot
@@ -73,45 +90,45 @@ install-common :
all-i18n : $(BUILDDIR) all-i18n : $(BUILDDIR)
@cd $(BUILDDIR) && $(MAKE) \ @cd $(BUILDDIR) && $(MAKE) \
I18N=-DLOCALEDIR=\'\"$(LOCALEDIR)\"\' \ top="$(top)" \
BUILD_CFLAGS="$(VERSION) $(DBUS_CFLAGS) $(CT_CFLAGS) $(LUA_CFLAGS) `$(PKG_CONFIG) --cflags libidn`" \ i18n=-DLOCALEDIR=\'\"$(LOCALEDIR)\"\' \
BUILD_LIBS="$(DBUS_LIBS) $(CT_LIBS) $(LUA_LIBS) $(SUNOS_LIBS) `$(PKG_CONFIG) --libs libidn`" \ build_cflags="$(version) $(dbus_cflags) $(ct_cflags) $(lua_cflags) `$(PKG_CONFIG) --cflags libidn`" \
-f ../Makefile dnsmasq build_libs="$(dbus_libs) $(ct_libs) $(lua_libs) $(sunos_libs) `$(PKG_CONFIG) --libs libidn`" \
@cd $(PO); for f in *.po; do \ -f $(top)/Makefile dnsmasq
cd ../$(BUILDDIR) && $(MAKE) \ for f in `cd $(PO); echo *.po`; do \
-f ../Makefile $${f%.po}.mo; \ cd $(top) && cd $(BUILDDIR) && $(MAKE) top="$(top)" -f $(top)/Makefile $${f%.po}.mo; \
done done
install-i18n : all-i18n install-common install-i18n : all-i18n install-common
cd $(BUILDDIR); ../bld/install-mo $(DESTDIR)$(LOCALEDIR) $(INSTALL) cd $(BUILDDIR); $(top)/bld/install-mo $(DESTDIR)$(LOCALEDIR) $(INSTALL)
cd $(MAN); ../bld/install-man $(DESTDIR)$(MANDIR) $(INSTALL) cd $(MAN); ../bld/install-man $(DESTDIR)$(MANDIR) $(INSTALL)
merge : $(BUILDDIR) merge :
@cd $(BUILDDIR) && $(MAKE) -f ../Makefile dnsmasq.pot @cd $(BUILDDIR) && $(MAKE) -f $(top)/Makefile dnsmasq.pot
@cd $(PO); for f in *.po; do \ for f in `cd $(PO); echo *.po`; do \
echo -n msgmerge $$f && $(MSGMERGE) --no-wrap -U $$f ../$(BUILDDIR)/dnsmasq.pot; \ echo -n msgmerge $(PO)/$$f && $(MSGMERGE) --no-wrap -U $(PO)/$$f $(BUILDDIR)/dnsmasq.pot; \
done done
$(BUILDDIR): $(BUILDDIR):
mkdir $(BUILDDIR) mkdir -p $(BUILDDIR)
# rules below are targets in recusive makes with cwd=$(SRC) # rules below are targets in recusive makes with cwd=$(SRC)
$(OBJS:.o=.c) $(HDRS): $(objs:.o=.c) $(hdrs):
ln -s ../$(SRC)/$@ . ln -s $(top)/$(SRC)/$@ .
.c.o: .c.o:
$(CC) $(CFLAGS) $(COPTS) $(I18N) $(BUILD_CFLAGS) $(RPM_OPT_FLAGS) -c $< $(CC) $(CFLAGS) $(COPTS) $(i18n) $(build_cflags) $(RPM_OPT_FLAGS) -c $<
dnsmasq : $(HDRS) $(OBJS) dnsmasq : $(hdrs) $(objs)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(BUILD_LIBS) $(LIBS) $(CC) $(LDFLAGS) -o $@ $(objs) $(build_libs) $(LIBS)
dnsmasq.pot : $(OBJS:.o=.c) $(HDRS) dnsmasq.pot : $(objs:.o=.c) $(hdrs)
$(XGETTEXT) -d dnsmasq --foreign-user --omit-header --keyword=_ -o $@ -i $(OBJS:.o=.c) $(XGETTEXT) -d dnsmasq --foreign-user --omit-header --keyword=_ -o $@ -i $(objs:.o=.c)
%.mo : ../po/%.po dnsmasq.pot %.mo : $(top)/$(PO)/%.po dnsmasq.pot
$(MSGMERGE) -o - ../po/$*.po dnsmasq.pot | $(MSGFMT) -o $*.mo - $(MSGMERGE) -o - $(top)/$(PO)/$*.po dnsmasq.pot | $(MSGFMT) -o $*.mo -
.PHONY : all clean install install-common all-i18n install-i18n merge .PHONY : all clean install install-common all-i18n install-i18n merge
+5 -8
View File
@@ -9,21 +9,18 @@
# If we can find one which matches $v[0-9].* then we assume it's # If we can find one which matches $v[0-9].* then we assume it's
# a version-number tag, else we just use the whole string. # a version-number tag, else we just use the whole string.
# we're called with pwd == TLD if which git >/dev/null 2>&1 && [ -d $1/.git ]; then
cd .. cd $1; git describe
elif grep '\$Format:%d\$' $1/VERSION >/dev/null 2>&1; then
if which git >/dev/null 2>&1 && [ -d .git ]; then
git describe
elif grep '\$Format:%d\$' VERSION >/dev/null 2>&1; then
# unsubstituted VERSION, but no git available. # unsubstituted VERSION, but no git available.
echo UNKNOWN echo UNKNOWN
else else
vers=`cat VERSION | sed 's/[(), ]/,/ g' | tr ',' '\n' | grep $v[0-9]` vers=`cat $1/VERSION | sed 's/[(), ]/,/ g' | tr ',' '\n' | grep $v[0-9]`
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "${vers}" | head -n 1 | tail -c +2 echo "${vers}" | head -n 1 | tail -c +2
else else
cat VERSION cat $1/VERSION
fi fi
fi fi
+1 -1
View File
@@ -4,6 +4,6 @@ for f in *; do
if [ -d $f ]; then if [ -d $f ]; then
$2 -m 755 -d $1/$f/man8 $2 -m 755 -d $1/$f/man8
$2 -m 644 $f/dnsmasq.8 $1/$f/man8 $2 -m 644 $f/dnsmasq.8 $1/$f/man8
echo installing $1/$f/man8/dnsmasq.8 echo installing $f/man8/dnsmasq.8
fi fi
done done
+1 -1
View File
@@ -3,7 +3,7 @@
for f in *.mo; do for f in *.mo; do
$2 -m 755 -d $1/${f%.mo}/LC_MESSAGES $2 -m 755 -d $1/${f%.mo}/LC_MESSAGES
$2 -m 644 $f $1/${f%.mo}/LC_MESSAGES/dnsmasq.mo $2 -m 644 $f $1/${f%.mo}/LC_MESSAGES/dnsmasq.mo
echo installing $1/${f%.mo}/LC_MESSAGES/dnsmasq.mo echo installing ${f%.mo}/LC_MESSAGES/dnsmasq.mo
done done
+10 -2
View File
@@ -161,9 +161,13 @@
# and defaults to 64 if missing/ # and defaults to 64 if missing/
#dhcp-range=1234::2, 1234::500, 64, 12h #dhcp-range=1234::2, 1234::500, 64, 12h
# Not Router Advertisements, BUT NOT DHCP for this subnet. # Do Router Advertisements, BUT NOT DHCP for this subnet.
#dhcp-range=1234::, ra-only #dhcp-range=1234::, ra-only
# Do Router Advertisements, BUT NOT DHCP for this subnet.
# Set the lifetime to 46 hours. (Note: minimum lifetime is 2 hours.)
#dhcp-range=1234::, ra-only, 48h
# Supply parameters for specified hosts using DHCP. There are lots # Supply parameters for specified hosts using DHCP. There are lots
# of valid alternatives, so we will give examples of each. Note that # of valid alternatives, so we will give examples of each. Note that
# IP addresses DO NOT have to be in the range given above, they just # IP addresses DO NOT have to be in the range given above, they just
@@ -284,7 +288,11 @@
#dhcp-option=option:ntp-server,192.168.0.4,10.10.0.5 #dhcp-option=option:ntp-server,192.168.0.4,10.10.0.5
# Send DHCPv6 option. Note [] around IPv6 addresses. # Send DHCPv6 option. Note [] around IPv6 addresses.
dhcp-option=option6:dns-server,[1234::77],[1234::88] #dhcp-option=option6:dns-server,[1234::77],[1234::88]
# Send DHCPv6 option for namservers as the machine running
# dnsmasq and another.
#dhcp-option=option6:dns-server,[::],[1234::88]
# Set the NTP time server address to be the same machine as # Set the NTP time server address to be the same machine as
# is running dnsmasq # is running dnsmasq
+9 -3
View File
@@ -704,7 +704,7 @@ and to set the time-server address to 192.168.0.4, do
.B --dhcp-option = 42,192.168.0.4 .B --dhcp-option = 42,192.168.0.4
or or
.B --dhcp-option = option:ntp-server, 192.168.0.4 .B --dhcp-option = option:ntp-server, 192.168.0.4
The special address 0.0.0.0 is taken to mean "the address of the The special address 0.0.0.0 (or [::] for DHCPv6) is taken to mean "the address of the
machine running dnsmasq". Data types allowed are comma separated machine running dnsmasq". Data types allowed are comma separated
dotted-quad IP addresses, a decimal number, colon-separated hex digits dotted-quad IP addresses, a decimal number, colon-separated hex digits
and a text string. If the optional tags are given then and a text string. If the optional tags are given then
@@ -1256,9 +1256,15 @@ existing DHCP configuration to provide most data. When RA is enabled,
dnsmasq will advertise a prefix for each dhcp-range, with default dnsmasq will advertise a prefix for each dhcp-range, with default
router and recursive DNS server as the relevant link-local address on router and recursive DNS server as the relevant link-local address on
the machine running dnsmasq. The "managed address" bits are set, the machine running dnsmasq. The "managed address" bits are set,
except for a dhcp-range which is marked as "ra-only". In which case RA except for a dhcp-range which is marked as "ra-only", in which case RA
is provided by no DHCPv6 service and the managed address bits are is provided by no DHCPv6 service and the managed address bits are
cleared. cleared.
.B enable-ra
enables router advertisement for prefixes where dnsmasq is doing
DHCPv6. It is not needed to "ra-only" prefixes. Creating an "ra-only"
prefix and not setting
.B enable-ra
sends advertisements only to "ra-only" prefixes.
.TP .TP
.B --enable-tftp[=<interface>] .B --enable-tftp[=<interface>]
Enable the TFTP server function. This is deliberately limited to that Enable the TFTP server function. This is deliberately limited to that
+275 -255
View File
File diff suppressed because it is too large. Load diff
+275 -255
View File
File diff suppressed because it is too large. Load diff
+281 -258
View File
File diff suppressed because it is too large. Load diff
+275 -255
View File
File diff suppressed because it is too large. Load diff
+279 -257
View File
File diff suppressed because it is too large. Load diff
+281 -258
View File
File diff suppressed because it is too large. Load diff
+275 -255
View File
File diff suppressed because it is too large. Load diff
+275 -255
View File
File diff suppressed because it is too large. Load diff
+281 -258
View File
File diff suppressed because it is too large. Load diff
+275 -255
View File
File diff suppressed because it is too large. Load diff
+12 -10
View File
@@ -377,24 +377,26 @@ void make_duid(time_t now)
static int make_duid1(int index, unsigned int type, char *mac, size_t maclen, void *parm) static int make_duid1(int index, unsigned int type, char *mac, size_t maclen, void *parm)
{ {
/* create DUID as specified in RFC3315. We use the MAC of the /* create DUID as specified in RFC3315. We use the MAC of the
first interface we find that isn't loopback or P-to-P */ first interface we find that isn't loopback or P-to-P and
has address-type < 256. Address types above 256 are things like
tunnels which don't have usable MAC addresses. */
unsigned char *p; unsigned char *p;
(void)index; (void)index;
if (type >= 256)
return 1;
#ifdef HAVE_BROKEN_RTC
daemon->duid = p = safe_malloc(maclen + 4);
daemon->duid_len = maclen + 4;
PUTSHORT(3, p); /* DUID_LL */
PUTSHORT(type, p); /* address type */
#else
daemon->duid = p = safe_malloc(maclen + 8); daemon->duid = p = safe_malloc(maclen + 8);
daemon->duid_len = maclen + 8; daemon->duid_len = maclen + 8;
#ifdef HAVE_BROKEN_RTC
PUTSHORT(3, p); /* DUID_LL */
#else
PUTSHORT(1, p); /* DUID_LLT */ PUTSHORT(1, p); /* DUID_LLT */
#endif
PUTSHORT(type, p); /* address type */ PUTSHORT(type, p); /* address type */
#ifndef HAVE_BROKEN_RTC
PUTLONG(*((time_t *)parm), p); /* time */ PUTLONG(*((time_t *)parm), p); /* time */
#endif #endif
+27 -6
View File
@@ -766,12 +766,33 @@ void receive_query(struct listener *listen, time_t now)
!iface_check(listen->family, &dst_addr, ifr.ifr_name)) !iface_check(listen->family, &dst_addr, ifr.ifr_name))
return; return;
if (listen->family == AF_INET && if (listen->family == AF_INET && option_bool(OPT_LOCALISE))
option_bool(OPT_LOCALISE) && {
ioctl(listen->fd, SIOCGIFNETMASK, &ifr) == -1) struct irec *iface;
return;
/* get the netmask of the interface whch has the address we were sent to.
netmask = ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr; This is no neccessarily the interface we arrived on. */
for (iface = daemon->interfaces; iface; iface = iface->next)
if (iface->addr.sa.sa_family == AF_INET &&
iface->addr.in.sin_addr.s_addr == dst_addr_4.s_addr)
break;
/* interface may be new */
if (!iface)
enumerate_interfaces();
for (iface = daemon->interfaces; iface; iface = iface->next)
if (iface->addr.sa.sa_family == AF_INET &&
iface->addr.in.sin_addr.s_addr == dst_addr_4.s_addr)
break;
/* If we failed, abandon localisation */
if (iface)
netmask = iface->netmask;
else
dst_addr_4.s_addr = 0;
}
} }
if (extract_request(header, (size_t)n, daemon->namebuff, &type)) if (extract_request(header, (size_t)n, daemon->namebuff, &type))
+2 -1
View File
@@ -614,7 +614,8 @@ void lease_set_expires(struct dhcp_lease *lease, unsigned int len, time_t now)
if (len != lease->length) if (len != lease->length)
{ {
lease->length = len; lease->length = len;
lease->aux_changed = file_dirty = 1; lease->flags |= LEASE_AUX_CHANGED;
file_dirty = 1;
} }
#endif #endif
} }
+8 -3
View File
@@ -54,7 +54,7 @@ void ra_init(time_t now)
int class = IPTOS_CLASS_CS6; int class = IPTOS_CLASS_CS6;
#endif #endif
int val = 255; /* radvd uses this value */ int val = 255; /* radvd uses this value */
size_t len = sizeof(int); socklen_t len = sizeof(int);
/* ensure this is around even if we're not doing DHCPv6 */ /* ensure this is around even if we're not doing DHCPv6 */
expand_buf(&daemon->outpacket, sizeof(struct dhcp_packet)); expand_buf(&daemon->outpacket, sizeof(struct dhcp_packet));
@@ -275,8 +275,13 @@ static int add_prefixes(struct in6_addr *local, int prefix,
is_same_net6(local, &context->end6, prefix)) is_same_net6(local, &context->end6, prefix))
{ {
if (!(context->flags & CONTEXT_RA_ONLY)) if (!(context->flags & CONTEXT_RA_ONLY))
param->managed = 1; {
/* don't do RA for non-ra-only unless --enable-ra is set */
if (!option_bool(OPT_RA))
continue;
param->managed = 1;
}
if (context->flags & CONTEXT_RA_DONE) if (context->flags & CONTEXT_RA_DONE)
continue; continue;
+1 -1
View File
@@ -25,7 +25,7 @@ static int add_resource_record(struct dns_header *header, char *limit, int *trun
((size_t)((pp) - (unsigned char *)(header) + (len)) <= (plen)) ((size_t)((pp) - (unsigned char *)(header) + (len)) <= (plen))
#define ADD_RDLEN(header, pp, plen, len) \ #define ADD_RDLEN(header, pp, plen, len) \
(!CHECK_LEN(header, pp, plen, len) ? 0 : (long)((pp) += (len)), 1) (!CHECK_LEN(header, pp, plen, len) ? 0 : (((pp) += (len)), 1))
static int extract_name(struct dns_header *header, size_t plen, unsigned char **pp, static int extract_name(struct dns_header *header, size_t plen, unsigned char **pp,
char *name, int isExtract, int extrabytes) char *name, int isExtract, int extrabytes)
+20 -5
View File
@@ -1177,11 +1177,27 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh
} }
o = new_opt6(opt_cfg->opt); o = new_opt6(opt_cfg->opt);
/* Maye be empty */ if (opt_cfg->flags & DHOPT_ADDR6)
if (opt_cfg->val) {
int j;
struct in6_addr *a = (struct in6_addr *)opt_cfg->val;
for (j = 0; j < opt_cfg->len; j+=IN6ADDRSZ, a++)
{
/* zero means "self" (but not in vendorclass options.) */
if (IN6_IS_ADDR_UNSPECIFIED(a))
{
if (IN6_IS_ADDR_UNSPECIFIED(&context->local6))
put_opt6(fallback, IN6ADDRSZ);
else
put_opt6(&context->local6, IN6ADDRSZ);
}
else
put_opt6(a, IN6ADDRSZ);
}
}
else if (opt_cfg->val)
put_opt6(opt_cfg->val, opt_cfg->len); put_opt6(opt_cfg->val, opt_cfg->len);
end_opt6(o); end_opt6(o);
} }
if (!done_dns && if (!done_dns &&
@@ -1200,8 +1216,7 @@ static int dhcp6_no_relay(int msg_type, struct in6_addr *link_address, struct dh
dhcp-option = vi-encap:13,17,....... */ dhcp-option = vi-encap:13,17,....... */
for (opt_cfg = daemon->dhcp_opts6; opt_cfg; opt_cfg = opt_cfg->next) for (opt_cfg = daemon->dhcp_opts6; opt_cfg; opt_cfg = opt_cfg->next)
opt_cfg->flags &= ~DHOPT_ENCAP_DONE; opt_cfg->flags &= ~DHOPT_ENCAP_DONE;
if (oro) if (oro)
for (i = 0; i < opt6_len(oro) - 1; i += 2) for (i = 0; i < opt6_len(oro) - 1; i += 2)
if (opt6_uint(oro, i, 2) == OPTION6_VENDOR_OPTS) if (opt6_uint(oro, i, 2) == OPTION6_VENDOR_OPTS)