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
e17b4b38
Commit
e17b4b38
authored
Jun 28, 2012
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix build-failure with -DNO_DHCP6.
parent
236e072c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
45 deletions
+39
-45
src/netlink.c
src/netlink.c
+39
-45
No files found.
src/netlink.c
View file @
e17b4b38
...
@@ -39,7 +39,6 @@ static struct iovec iov;
...
@@ -39,7 +39,6 @@ static struct iovec iov;
static
u32
netlink_pid
;
static
u32
netlink_pid
;
static
int
nl_async
(
struct
nlmsghdr
*
h
);
static
int
nl_async
(
struct
nlmsghdr
*
h
);
static
void
nl_routechange
(
struct
nlmsghdr
*
h
);
void
netlink_init
(
void
)
void
netlink_init
(
void
)
{
{
...
@@ -342,59 +341,54 @@ static int nl_async(struct nlmsghdr *h)
...
@@ -342,59 +341,54 @@ static int nl_async(struct nlmsghdr *h)
}
}
else
if
(
h
->
nlmsg_pid
==
0
&&
h
->
nlmsg_type
==
RTM_NEWROUTE
)
else
if
(
h
->
nlmsg_pid
==
0
&&
h
->
nlmsg_type
==
RTM_NEWROUTE
)
{
{
nl_routechange
(
h
);
/* We arrange to receive netlink multicast messages whenever the network route is added.
If this happens and we still have a DNS packet in the buffer, we re-send it.
This helps on DoD links, where frequently the packet which triggers dialling is
a DNS query, which then gets lost. By re-sending, we can avoid the lookup
failing. */
struct
rtmsg
*
rtm
=
NLMSG_DATA
(
h
);
if
(
rtm
->
rtm_type
==
RTN_UNICAST
&&
rtm
->
rtm_scope
==
RT_SCOPE_LINK
)
{
/* Force re-reading resolv file right now, for luck. */
daemon
->
last_resolv
=
0
;
if
(
daemon
->
srv_save
)
{
int
fd
;
if
(
daemon
->
srv_save
->
sfd
)
fd
=
daemon
->
srv_save
->
sfd
->
fd
;
else
if
(
daemon
->
rfd_save
&&
daemon
->
rfd_save
->
refcount
!=
0
)
fd
=
daemon
->
rfd_save
->
fd
;
else
return
0
;
while
(
sendto
(
fd
,
daemon
->
packet
,
daemon
->
packet_len
,
0
,
&
daemon
->
srv_save
->
addr
.
sa
,
sa_len
(
&
daemon
->
srv_save
->
addr
))
==
-
1
&&
retry_send
());
}
}
return
0
;
return
0
;
}
}
#ifdef HAVE_DHCP6
else
if
(
h
->
nlmsg_type
==
RTM_NEWADDR
)
else
if
(
h
->
nlmsg_type
==
RTM_NEWADDR
)
{
/* force RAs to sync new network and pick up new interfaces. */
if
(
daemon
->
ra_contexts
)
{
{
#ifdef HAVE_DHCP6
schedule_subnet_map
();
/* force RAs to sync new network and pick up new interfaces. */
ra_start_unsolicted
(
dnsmasq_time
(),
NULL
);
if
(
daemon
->
ra_contexts
)
/* cause lease_update_file to run after we return, in case we were called from
{
iface_enumerate and can't re-enter it now */
schedule_subnet_map
();
send_alarm
(
0
,
0
);
ra_start_unsolicted
(
dnsmasq_time
(),
NULL
);
/* cause lease_update_file to run after we return, in case we were called from
iface_enumerate and can't re-enter it now */
send_alarm
(
0
,
0
);
}
return
1
;
/* clever bind mode - rescan */
}
}
return
1
;
/* clever bind mode - rescan */
}
#endif
#endif
return
0
;
return
0
;
}
}
/* We arrange to receive netlink multicast messages whenever the network route is added.
If this happens and we still have a DNS packet in the buffer, we re-send it.
This helps on DoD links, where frequently the packet which triggers dialling is
a DNS query, which then gets lost. By re-sending, we can avoid the lookup
failing. */
static
void
nl_routechange
(
struct
nlmsghdr
*
h
)
{
struct
rtmsg
*
rtm
=
NLMSG_DATA
(
h
);
int
fd
;
if
(
rtm
->
rtm_type
!=
RTN_UNICAST
||
rtm
->
rtm_scope
!=
RT_SCOPE_LINK
)
return
;
/* Force re-reading resolv file right now, for luck. */
daemon
->
last_resolv
=
0
;
if
(
daemon
->
srv_save
)
{
if
(
daemon
->
srv_save
->
sfd
)
fd
=
daemon
->
srv_save
->
sfd
->
fd
;
else
if
(
daemon
->
rfd_save
&&
daemon
->
rfd_save
->
refcount
!=
0
)
fd
=
daemon
->
rfd_save
->
fd
;
else
return
;
while
(
sendto
(
fd
,
daemon
->
packet
,
daemon
->
packet_len
,
0
,
&
daemon
->
srv_save
->
addr
.
sa
,
sa_len
(
&
daemon
->
srv_save
->
addr
))
==
-
1
&&
retry_send
());
}
}
#endif
#endif
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