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
ffbad34b
Commit
ffbad34b
authored
Aug 14, 2013
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set SOREUSEADDR as well as SOREUSEPORT on DHCP sockets when both available.
parent
f086d396
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
src/dhcp.c
src/dhcp.c
+4
-4
src/dhcp6.c
src/dhcp6.c
+4
-4
No files found.
src/dhcp.c
View file @
ffbad34b
...
@@ -70,15 +70,15 @@ static int make_fd(int port)
...
@@ -70,15 +70,15 @@ static int make_fd(int port)
support it. This handles the introduction of REUSEPORT on Linux. */
support it. This handles the introduction of REUSEPORT on Linux. */
if
(
option_bool
(
OPT_NOWILD
)
||
option_bool
(
OPT_CLEVERBIND
))
if
(
option_bool
(
OPT_NOWILD
)
||
option_bool
(
OPT_CLEVERBIND
))
{
{
int
rc
=
-
1
,
porterr
=
0
;
int
rc
=
0
;
#ifdef SO_REUSEPORT
#ifdef SO_REUSEPORT
if
((
rc
=
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEPORT
,
&
oneopt
,
sizeof
(
oneopt
)))
==
-
1
&&
if
((
rc
=
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEPORT
,
&
oneopt
,
sizeof
(
oneopt
)))
==
-
1
&&
errno
!
=
ENOPROTOOPT
)
errno
=
=
ENOPROTOOPT
)
porterr
=
1
;
rc
=
0
;
#endif
#endif
if
(
rc
==
-
1
&&
!
porterr
)
if
(
rc
!=
-
1
)
rc
=
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
oneopt
,
sizeof
(
oneopt
));
rc
=
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
oneopt
,
sizeof
(
oneopt
));
if
(
rc
==
-
1
)
if
(
rc
==
-
1
)
...
...
src/dhcp6.c
View file @
ffbad34b
...
@@ -55,15 +55,15 @@ void dhcp6_init(void)
...
@@ -55,15 +55,15 @@ void dhcp6_init(void)
support it. This handles the introduction of REUSEPORT on Linux. */
support it. This handles the introduction of REUSEPORT on Linux. */
if
(
option_bool
(
OPT_NOWILD
)
||
option_bool
(
OPT_CLEVERBIND
))
if
(
option_bool
(
OPT_NOWILD
)
||
option_bool
(
OPT_CLEVERBIND
))
{
{
int
rc
=
-
1
,
porterr
=
0
;
int
rc
=
0
;
#ifdef SO_REUSEPORT
#ifdef SO_REUSEPORT
if
((
rc
=
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEPORT
,
&
oneopt
,
sizeof
(
oneopt
)))
==
-
1
&&
if
((
rc
=
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEPORT
,
&
oneopt
,
sizeof
(
oneopt
)))
==
-
1
&&
errno
!
=
ENOPROTOOPT
)
errno
=
=
ENOPROTOOPT
)
porterr
=
1
;
rc
=
0
;
#endif
#endif
if
(
rc
==
-
1
&&
!
porterr
)
if
(
rc
!=
-
1
)
rc
=
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
oneopt
,
sizeof
(
oneopt
));
rc
=
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
oneopt
,
sizeof
(
oneopt
));
if
(
rc
==
-
1
)
if
(
rc
==
-
1
)
...
...
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