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
2022310f
Commit
2022310f
authored
Oct 15, 2012
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SO_REUSEADDR and SO_V6ONLY options on DHCPv6 socket.
parent
657ed096
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
CHANGELOG
CHANGELOG
+5
-0
src/dhcp6.c
src/dhcp6.c
+17
-1
No files found.
CHANGELOG
View file @
2022310f
...
@@ -32,6 +32,11 @@ version 2.64
...
@@ -32,6 +32,11 @@ version 2.64
infinte loop at startup. Regression in 2.63. Thanks to
infinte loop at startup. Regression in 2.63. Thanks to
Haim Gelfenbeyn for spotting this.
Haim Gelfenbeyn for spotting this.
Set SO_REUSEADDRESS and SO_V6ONLY options on the DHCPv6
socket, this allows multiple instances of dnsmasq on a
single machine, in the same way as for DHCPv4. Thanks to
Gene Czarcinski and Vladislav Grishenko for work on this.
version 2.63
version 2.63
Do duplicate dhcp-host address check in --test mode.
Do duplicate dhcp-host address check in --test mode.
...
...
src/dhcp6.c
View file @
2022310f
...
@@ -36,15 +36,31 @@ void dhcp6_init(void)
...
@@ -36,15 +36,31 @@ void dhcp6_init(void)
#if defined(IPV6_TCLASS) && defined(IPTOS_CLASS_CS6)
#if defined(IPV6_TCLASS) && defined(IPTOS_CLASS_CS6)
int
class
=
IPTOS_CLASS_CS6
;
int
class
=
IPTOS_CLASS_CS6
;
#endif
#endif
int
oneopt
=
1
;
if
((
fd
=
socket
(
PF_INET6
,
SOCK_DGRAM
,
IPPROTO_UDP
))
==
-
1
||
if
((
fd
=
socket
(
PF_INET6
,
SOCK_DGRAM
,
IPPROTO_UDP
))
==
-
1
||
#if defined(IPV6_TCLASS) && defined(IPTOS_CLASS_CS6)
#if defined(IPV6_TCLASS) && defined(IPTOS_CLASS_CS6)
setsockopt
(
fd
,
IPPROTO_IPV6
,
IPV6_TCLASS
,
&
class
,
sizeof
(
class
))
==
-
1
||
setsockopt
(
fd
,
IPPROTO_IPV6
,
IPV6_TCLASS
,
&
class
,
sizeof
(
class
))
==
-
1
||
#endif
#endif
setsockopt
(
fd
,
IPPROTO_IPV6
,
IPV6_V6ONLY
,
&
oneopt
,
sizeof
(
oneopt
))
==
-
1
||
!
fix_fd
(
fd
)
||
!
fix_fd
(
fd
)
||
!
set_ipv6pktinfo
(
fd
))
!
set_ipv6pktinfo
(
fd
))
die
(
_
(
"cannot create DHCPv6 socket: %s"
),
NULL
,
EC_BADNET
);
die
(
_
(
"cannot create DHCPv6 socket: %s"
),
NULL
,
EC_BADNET
);
/* When bind-interfaces is set, there might be more than one dnmsasq
instance binding port 547. That's OK if they serve different networks.
Need to set REUSEADDR to make this posible, or REUSEPORT on *BSD. */
if
(
option_bool
(
OPT_NOWILD
)
||
option_bool
(
OPT_CLEVERBIND
))
{
#ifdef SO_REUSEPORT
int
rc
=
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEPORT
,
&
oneopt
,
sizeof
(
oneopt
));
#else
int
rc
=
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
oneopt
,
sizeof
(
oneopt
));
#endif
if
(
rc
==
-
1
)
die
(
_
(
"failed to set SO_REUSE{ADDR|PORT} on DHCPv6 socket: %s"
),
NULL
,
EC_BADNET
);
}
memset
(
&
saddr
,
0
,
sizeof
(
saddr
));
memset
(
&
saddr
,
0
,
sizeof
(
saddr
));
#ifdef HAVE_SOCKADDR_SA_LEN
#ifdef HAVE_SOCKADDR_SA_LEN
saddr
.
sin6_len
=
sizeof
(
struct
sockaddr_in6
);
saddr
.
sin6_len
=
sizeof
(
struct
sockaddr_in6
);
...
...
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