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
e2ba0df2
Commit
e2ba0df2
authored
May 31, 2013
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't BIND DHCP socket if more interfaces may come along later.
parent
921360ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
+19
-7
CHANGELOG
CHANGELOG
+6
-0
src/dhcp-common.c
src/dhcp-common.c
+13
-7
No files found.
CHANGELOG
View file @
e2ba0df2
...
@@ -50,6 +50,12 @@ version 2.67
...
@@ -50,6 +50,12 @@ version 2.67
Log when the maximum number of concurrent DNS queries is
Log when the maximum number of concurrent DNS queries is
reached. Thanks to Marcelo Salhab Brogliato for the patch.
reached. Thanks to Marcelo Salhab Brogliato for the patch.
If wildcards are used in --interface, don't assume that
there will only ever be one available interface for DHCP
just because there is one at start-up. More may appear, so
we can't use SO_BINDTODEVICE. Thanks to Natrio for the bug
report.
version 2.66
version 2.66
Add the ability to act as an authoritative DNS
Add the ability to act as an authoritative DNS
...
...
src/dhcp-common.c
View file @
e2ba0df2
...
@@ -347,21 +347,27 @@ void bindtodevice(int fd)
...
@@ -347,21 +347,27 @@ void bindtodevice(int fd)
to that device. This is for the use case of (eg) OpenStack, which runs a new
to that device. This is for the use case of (eg) OpenStack, which runs a new
dnsmasq instance for each VLAN interface it creates. Without the BINDTODEVICE,
dnsmasq instance for each VLAN interface it creates. Without the BINDTODEVICE,
individual processes don't always see the packets they should.
individual processes don't always see the packets they should.
SO_BINDTODEVICE is only available Linux. */
SO_BINDTODEVICE is only available Linux.
Note that if wildcards are used in --interface, or a configured interface doesn't
yet exist, then more interfaces may arrive later, so we can't safely assert there
is only one interface and proceed.
*/
struct
irec
*
iface
,
*
found
;
struct
irec
*
iface
,
*
found
;
struct
iname
*
if_tmp
;
for
(
if_tmp
=
daemon
->
if_names
;
if_tmp
;
if_tmp
=
if_tmp
->
next
)
if
(
if_tmp
->
name
&&
(
!
if_tmp
->
used
||
strchr
(
if_tmp
->
name
,
'*'
)))
return
;
for
(
found
=
NULL
,
iface
=
daemon
->
interfaces
;
iface
;
iface
=
iface
->
next
)
for
(
found
=
NULL
,
iface
=
daemon
->
interfaces
;
iface
;
iface
=
iface
->
next
)
if
(
iface
->
dhcp_ok
)
if
(
iface
->
dhcp_ok
)
{
{
if
(
!
found
)
if
(
!
found
)
found
=
iface
;
found
=
iface
;
else
if
(
strcmp
(
found
->
name
,
iface
->
name
)
!=
0
)
else
if
(
strcmp
(
found
->
name
,
iface
->
name
)
!=
0
)
{
return
;
/* more than one. */
/* more than one. */
found
=
NULL
;
break
;
}
}
}
if
(
found
)
if
(
found
)
...
...
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