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
56a1142f
Commit
56a1142f
authored
Apr 02, 2013
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SO_REUSEPORT may be defined, but not supported.
parent
5b37aa8c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
9 deletions
+30
-9
CHANGELOG
CHANGELOG
+5
-0
src/dhcp.c
src/dhcp.c
+12
-4
src/dhcp6.c
src/dhcp6.c
+13
-5
No files found.
CHANGELOG
View file @
56a1142f
...
...
@@ -52,6 +52,11 @@ version 2.66
Allow a trailing '*' wildcard in all interface-name
configurations. Thanks to Christian Parpart for the patch.
Handle the situation where libc headers define
SO_REUSEPORT, but the kernel in use doesn't, to cope with
the introduction of this option to Linux. Thanks to Rich
Felker for the bug report.
version 2.65
Fix regression which broke forwarding of queries sent via
...
...
src/dhcp.c
View file @
56a1142f
...
...
@@ -65,14 +65,22 @@ static int make_fd(int port)
/* When bind-interfaces is set, there might be more than one dnmsasq
instance binding port 67. That's OK if they serve different networks.
Need to set REUSEADDR to make this posible, or REUSEPORT on *BSD. */
Need to set REUSEADDR|REUSEPORT to make this posible.
Handle the case that REUSEPORT is defined, but the kernel doesn't
support it. This handles the introduction of REUSEPORT on Linux. */
if
(
option_bool
(
OPT_NOWILD
)
||
option_bool
(
OPT_CLEVERBIND
))
{
int
rc
=
-
1
,
porterr
=
0
;
#ifdef SO_REUSEPORT
i
nt
rc
=
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEPORT
,
&
oneopt
,
sizeof
(
oneopt
));
#else
int
rc
=
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
oneopt
,
sizeof
(
oneopt
))
;
i
f
((
rc
=
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEPORT
,
&
oneopt
,
sizeof
(
oneopt
)))
==
-
1
&&
errno
!=
ENOPROTOOPT
)
porterr
=
1
;
#endif
if
(
rc
==
-
1
&&
!
porterr
)
rc
=
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
oneopt
,
sizeof
(
oneopt
));
if
(
rc
==
-
1
)
die
(
_
(
"failed to set SO_REUSE{ADDR|PORT} on DHCP socket: %s"
),
NULL
,
EC_BADNET
);
}
...
...
src/dhcp6.c
View file @
56a1142f
...
...
@@ -48,16 +48,24 @@ void dhcp6_init(void)
!
set_ipv6pktinfo
(
fd
))
die
(
_
(
"cannot create DHCPv6 socket: %s"
),
NULL
,
EC_BADNET
);
/* When bind-interfaces is set, there might be more than one dnmsasq
/* 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. */
Need to set REUSEADDR|REUSEPORT to make this posible.
Handle the case that REUSEPORT is defined, but the kernel doesn't
support it. This handles the introduction of REUSEPORT on Linux. */
if
(
option_bool
(
OPT_NOWILD
)
||
option_bool
(
OPT_CLEVERBIND
))
{
int
rc
=
-
1
,
porterr
=
0
;
#ifdef SO_REUSEPORT
i
nt
rc
=
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEPORT
,
&
oneopt
,
sizeof
(
oneopt
));
#else
int
rc
=
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
oneopt
,
sizeof
(
oneopt
))
;
i
f
((
rc
=
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEPORT
,
&
oneopt
,
sizeof
(
oneopt
)))
==
-
1
&&
errno
!=
ENOPROTOOPT
)
porterr
=
1
;
#endif
if
(
rc
==
-
1
&&
!
porterr
)
rc
=
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
oneopt
,
sizeof
(
oneopt
));
if
(
rc
==
-
1
)
die
(
_
(
"failed to set SO_REUSE{ADDR|PORT} on DHCPv6 socket: %s"
),
NULL
,
EC_BADNET
);
}
...
...
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