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
5f11b3e5
Commit
5f11b3e5
authored
Aug 16, 2012
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cope with --listen-address for not yet existent addr in bind-dynamic mode.
parent
3169daad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
src/network.c
src/network.c
+14
-4
No files found.
src/network.c
View file @
5f11b3e5
...
@@ -338,13 +338,22 @@ static int make_sock(union mysockaddr *addr, int type, int dienow)
...
@@ -338,13 +338,22 @@ static int make_sock(union mysockaddr *addr, int type, int dienow)
sprintf
(
daemon
->
addrbuff
,
"port %d"
,
port
);
sprintf
(
daemon
->
addrbuff
,
"port %d"
,
port
);
s
=
_
(
"failed to create listening socket for %s: %s"
);
s
=
_
(
"failed to create listening socket for %s: %s"
);
if
(
fd
!=
-
1
)
close
(
fd
);
if
(
dienow
)
if
(
dienow
)
die
(
s
,
daemon
->
addrbuff
,
EC_BADNET
);
{
/* failure to bind addresses given by --listen-address at this point
is OK if we're doing bind-dynamic */
if
(
!
option_bool
(
OPT_CLEVERBIND
))
die
(
s
,
daemon
->
addrbuff
,
EC_BADNET
);
}
else
my_syslog
(
LOG_WARNING
,
s
,
daemon
->
addrbuff
,
strerror
(
errno
));
my_syslog
(
LOG_ERR
,
s
,
daemon
->
addrbuff
,
strerror
(
errno
));
return
-
1
;
return
-
1
;
}
}
if
(
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
opt
,
sizeof
(
opt
))
==
-
1
||
!
fix_fd
(
fd
))
if
(
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
opt
,
sizeof
(
opt
))
==
-
1
||
!
fix_fd
(
fd
))
goto
err
;
goto
err
;
...
@@ -513,7 +522,8 @@ void create_bound_listeners(int dienow)
...
@@ -513,7 +522,8 @@ void create_bound_listeners(int dienow)
no interface with a matching address. These may be valid: eg it's possible
no interface with a matching address. These may be valid: eg it's possible
to listen on 127.0.1.1 even if the loopback interface is 127.0.0.1
to listen on 127.0.1.1 even if the loopback interface is 127.0.0.1
If the address isn't valid the bind() will fail and we'll die().
If the address isn't valid the bind() will fail and we'll die()
(except in bind-dynamic mode, when we'll complain but keep trying.)
The resulting listeners have the ->iface field NULL, and this has to be
The resulting listeners have the ->iface field NULL, and this has to be
handled by the DNS and TFTP code. It disables --localise-queries processing
handled by the DNS and TFTP code. It disables --localise-queries processing
...
...
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