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
d203af4a
Commit
d203af4a
authored
May 10, 2017
by
Petr Menšík
Committed by
Simon Kelley
May 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add optional support for libidn2 and therefore IDNA2008.
parent
05f76dab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
8 deletions
+27
-8
Makefile
Makefile
+4
-2
src/config.h
src/config.h
+9
-1
src/util.c
src/util.c
+14
-5
No files found.
Makefile
View file @
d203af4a
...
@@ -55,6 +55,8 @@ dbus_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DBUS $(PKG_CONFIG)
...
@@ -55,6 +55,8 @@ dbus_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DBUS $(PKG_CONFIG)
dbus_libs
=
`
echo
$(COPTS)
|
$(top)
/bld/pkg-wrapper HAVE_DBUS
$(PKG_CONFIG)
--libs
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_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
`
idn_libs
=
`
echo
$(COPTS)
|
$(top)
/bld/pkg-wrapper HAVE_IDN
$(PKG_CONFIG)
--libs
libidn
`
idn2_cflags
=
`
echo
$(COPTS)
|
$(top)
/bld/pkg-wrapper HAVE_LIBIDN2
$(PKG_CONFIG)
--cflags
libidn2
`
idn2_libs
=
`
echo
$(COPTS)
|
$(top)
/bld/pkg-wrapper HAVE_LIBIDN2
$(PKG_CONFIG)
--libs
libidn2
`
ct_cflags
=
`
echo
$(COPTS)
|
$(top)
/bld/pkg-wrapper HAVE_CONNTRACK
$(PKG_CONFIG)
--cflags
libnetfilter_conntrack
`
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
`
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.2
`
lua_cflags
=
`
echo
$(COPTS)
|
$(top)
/bld/pkg-wrapper HAVE_LUASCRIPT
$(PKG_CONFIG)
--cflags
lua5.2
`
...
@@ -82,8 +84,8 @@ hdrs = dnsmasq.h config.h dhcp-protocol.h dhcp6-protocol.h \
...
@@ -82,8 +84,8 @@ hdrs = dnsmasq.h config.h dhcp-protocol.h dhcp6-protocol.h \
all
:
$(BUILDDIR)
all
:
$(BUILDDIR)
@
cd
$(BUILDDIR)
&&
$(MAKE)
\
@
cd
$(BUILDDIR)
&&
$(MAKE)
\
top
=
"
$(top)
"
\
top
=
"
$(top)
"
\
build_cflags
=
"
$(version)
$(dbus_cflags)
$(idn_cflags)
$(ct_cflags)
$(lua_cflags)
$(nettle_cflags)
"
\
build_cflags
=
"
$(version)
$(dbus_cflags)
$(idn
2_cflags)
$(idn
_cflags)
$(ct_cflags)
$(lua_cflags)
$(nettle_cflags)
"
\
build_libs
=
"
$(dbus_libs)
$(idn_libs)
$(ct_libs)
$(lua_libs)
$(sunos_libs)
$(nettle_libs)
$(gmp_libs)
"
\
build_libs
=
"
$(dbus_libs)
$(idn
2_libs)
$(idn
_libs)
$(ct_libs)
$(lua_libs)
$(sunos_libs)
$(nettle_libs)
$(gmp_libs)
"
\
-f
$(top)
/Makefile dnsmasq
-f
$(top)
/Makefile dnsmasq
mostly_clean
:
mostly_clean
:
...
...
src/config.h
View file @
d203af4a
...
@@ -94,11 +94,14 @@ HAVE_DBUS
...
@@ -94,11 +94,14 @@ HAVE_DBUS
servers via DBus.
servers via DBus.
HAVE_IDN
HAVE_IDN
define this if you want international domain name support.
define this if you want international domain name
2003
support.
NOTE: for backwards compatibility, IDN support is automatically
NOTE: for backwards compatibility, IDN support is automatically
included when internationalisation support is built, using the
included when internationalisation support is built, using the
*-i18n makefile targets, even if HAVE_IDN is not explicitly set.
*-i18n makefile targets, even if HAVE_IDN is not explicitly set.
HAVE_LIBIDN2
define this if you want international domain name 2008 support.
HAVE_CONNTRACK
HAVE_CONNTRACK
define this to include code which propagates conntrack marks from
define this to include code which propagates conntrack marks from
incoming DNS queries to the corresponding upstream queries. This adds
incoming DNS queries to the corresponding upstream queries. This adds
...
@@ -177,6 +180,7 @@ RESOLVFILE
...
@@ -177,6 +180,7 @@ RESOLVFILE
/* #define HAVE_LUASCRIPT */
/* #define HAVE_LUASCRIPT */
/* #define HAVE_DBUS */
/* #define HAVE_DBUS */
/* #define HAVE_IDN */
/* #define HAVE_IDN */
/* #define HAVE_LIBIDN2 */
/* #define HAVE_CONNTRACK */
/* #define HAVE_CONNTRACK */
/* #define HAVE_DNSSEC */
/* #define HAVE_DNSSEC */
...
@@ -400,6 +404,10 @@ static char *compile_opts =
...
@@ -400,6 +404,10 @@ static char *compile_opts =
"no-"
"no-"
#endif
#endif
"IDN "
"IDN "
#if !defined(HAVE_LIBIDN2)
"no-"
#endif
"IDN2 "
#ifndef HAVE_DHCP
#ifndef HAVE_DHCP
"no-"
"no-"
#endif
#endif
...
...
src/util.c
View file @
d203af4a
...
@@ -24,7 +24,9 @@
...
@@ -24,7 +24,9 @@
#include <sys/times.h>
#include <sys/times.h>
#endif
#endif
#if defined(LOCALEDIR) || defined(HAVE_IDN)
#ifdef HAVE_LIBIDN2
#include <idn2.h>
#elif defined(LOCALEDIR) || defined(HAVE_IDN)
#include <idna.h>
#include <idna.h>
#endif
#endif
...
@@ -134,7 +136,7 @@ static int check_name(char *in)
...
@@ -134,7 +136,7 @@ static int check_name(char *in)
else
if
(
isascii
((
unsigned
char
)
c
)
&&
iscntrl
((
unsigned
char
)
c
))
else
if
(
isascii
((
unsigned
char
)
c
)
&&
iscntrl
((
unsigned
char
)
c
))
/* iscntrl only gives expected results for ascii */
/* iscntrl only gives expected results for ascii */
return
0
;
return
0
;
#if !defined(LOCALEDIR) && !defined(HAVE_IDN)
#if !defined(LOCALEDIR) && !defined(HAVE_IDN)
&& !defined(HAVE_LIBIDN2)
else
if
(
!
isascii
((
unsigned
char
)
c
))
else
if
(
!
isascii
((
unsigned
char
)
c
))
return
0
;
return
0
;
#endif
#endif
...
@@ -184,7 +186,7 @@ int legal_hostname(char *name)
...
@@ -184,7 +186,7 @@ int legal_hostname(char *name)
char
*
canonicalise
(
char
*
in
,
int
*
nomem
)
char
*
canonicalise
(
char
*
in
,
int
*
nomem
)
{
{
char
*
ret
=
NULL
;
char
*
ret
=
NULL
;
#if defined(LOCALEDIR) || defined(HAVE_IDN)
#if defined(LOCALEDIR) || defined(HAVE_IDN)
|| defined(HAVE_LIBIDN2)
int
rc
;
int
rc
;
#endif
#endif
...
@@ -194,8 +196,15 @@ char *canonicalise(char *in, int *nomem)
...
@@ -194,8 +196,15 @@ char *canonicalise(char *in, int *nomem)
if
(
!
check_name
(
in
))
if
(
!
check_name
(
in
))
return
NULL
;
return
NULL
;
#if defined(LOCALEDIR) || defined(HAVE_IDN)
#if defined(LOCALEDIR) || defined(HAVE_IDN) || defined(HAVE_LIBIDN2)
if
((
rc
=
idna_to_ascii_lz
(
in
,
&
ret
,
0
))
!=
IDNA_SUCCESS
)
#ifdef HAVE_LIBIDN2
rc
=
idn2_to_ascii_lz
(
in
,
&
ret
,
IDN2_NONTRANSITIONAL
);
if
(
rc
==
IDN2_DISALLOWED
)
rc
=
idn2_to_ascii_lz
(
in
,
&
ret
,
IDN2_TRANSITIONAL
);
#else
rc
=
idna_to_ascii_lz
(
in
,
&
ret
,
0
);
#endif
if
(
rc
!=
IDNA_SUCCESS
)
{
{
if
(
ret
)
if
(
ret
)
free
(
ret
);
free
(
ret
);
...
...
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