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
bad7b875
Commit
bad7b875
authored
Dec 20, 2012
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add general flag param to iface_enumerate IPv6 callback
parent
5d162f20
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
17 deletions
+29
-17
src/dhcp6.c
src/dhcp6.c
+5
-5
src/dnsmasq.h
src/dnsmasq.h
+5
-0
src/lease.c
src/lease.c
+2
-2
src/netlink.c
src/netlink.c
+9
-1
src/network.c
src/network.c
+2
-2
src/radv.c
src/radv.c
+6
-7
No files found.
src/dhcp6.c
View file @
bad7b875
...
@@ -25,7 +25,7 @@ struct iface_param {
...
@@ -25,7 +25,7 @@ struct iface_param {
};
};
static
int
complete_context6
(
struct
in6_addr
*
local
,
int
prefix
,
static
int
complete_context6
(
struct
in6_addr
*
local
,
int
prefix
,
int
scope
,
int
if_index
,
int
dad
,
int
scope
,
int
if_index
,
int
flags
,
int
preferred
,
int
valid
,
void
*
vparam
);
int
preferred
,
int
valid
,
void
*
vparam
);
static
int
make_duid1
(
int
index
,
unsigned
int
type
,
char
*
mac
,
size_t
maclen
,
void
*
parm
);
static
int
make_duid1
(
int
index
,
unsigned
int
type
,
char
*
mac
,
size_t
maclen
,
void
*
parm
);
...
@@ -182,7 +182,7 @@ void dhcp6_packet(time_t now)
...
@@ -182,7 +182,7 @@ void dhcp6_packet(time_t now)
}
}
static
int
complete_context6
(
struct
in6_addr
*
local
,
int
prefix
,
static
int
complete_context6
(
struct
in6_addr
*
local
,
int
prefix
,
int
scope
,
int
if_index
,
int
dad
,
int
preferred
,
int
scope
,
int
if_index
,
int
flags
,
int
preferred
,
int
valid
,
void
*
vparam
)
int
valid
,
void
*
vparam
)
{
{
struct
dhcp_context
*
context
;
struct
dhcp_context
*
context
;
...
@@ -190,7 +190,7 @@ static int complete_context6(struct in6_addr *local, int prefix,
...
@@ -190,7 +190,7 @@ static int complete_context6(struct in6_addr *local, int prefix,
struct
iname
*
tmp
;
struct
iname
*
tmp
;
(
void
)
scope
;
/* warning */
(
void
)
scope
;
/* warning */
(
void
)
dad
;
(
void
)
flags
;
(
void
)
preferred
;
(
void
)
preferred
;
(
void
)
valid
;
(
void
)
valid
;
...
@@ -479,7 +479,7 @@ struct cparam {
...
@@ -479,7 +479,7 @@ struct cparam {
};
};
static
int
construct_worker
(
struct
in6_addr
*
local
,
int
prefix
,
static
int
construct_worker
(
struct
in6_addr
*
local
,
int
prefix
,
int
scope
,
int
if_index
,
int
dad
,
int
scope
,
int
if_index
,
int
flags
,
int
preferred
,
int
valid
,
void
*
vparam
)
int
preferred
,
int
valid
,
void
*
vparam
)
{
{
char
ifrn_name
[
IFNAMSIZ
];
char
ifrn_name
[
IFNAMSIZ
];
...
@@ -487,7 +487,7 @@ static int construct_worker(struct in6_addr *local, int prefix,
...
@@ -487,7 +487,7 @@ static int construct_worker(struct in6_addr *local, int prefix,
struct
dhcp_context
*
template
,
*
context
;
struct
dhcp_context
*
template
,
*
context
;
(
void
)
scope
;
(
void
)
scope
;
(
void
)
dad
;
(
void
)
flags
;
struct
cparam
*
param
=
vparam
;
struct
cparam
*
param
=
vparam
;
...
...
src/dnsmasq.h
View file @
bad7b875
...
@@ -389,6 +389,11 @@ union mysockaddr {
...
@@ -389,6 +389,11 @@ union mysockaddr {
#endif
#endif
};
};
/* bits in flag param to IPv6 callbacks from iface_enumerate() */
#define IFACE_TENTATIVE 1
#define IFACE_DEPRECATED 2
#define SERV_FROM_RESOLV 1
/* 1 for servers from resolv, 0 for command line. */
#define SERV_FROM_RESOLV 1
/* 1 for servers from resolv, 0 for command line. */
#define SERV_NO_ADDR 2
/* no server, this domain is local only */
#define SERV_NO_ADDR 2
/* no server, this domain is local only */
#define SERV_LITERAL_ADDRESS 4
/* addr is the answer, not the server */
#define SERV_LITERAL_ADDRESS 4
/* addr is the answer, not the server */
...
...
src/lease.c
View file @
bad7b875
...
@@ -363,13 +363,13 @@ static int find_interface_v4(struct in_addr local, int if_index,
...
@@ -363,13 +363,13 @@ static int find_interface_v4(struct in_addr local, int if_index,
#ifdef HAVE_DHCP6
#ifdef HAVE_DHCP6
static
int
find_interface_v6
(
struct
in6_addr
*
local
,
int
prefix
,
static
int
find_interface_v6
(
struct
in6_addr
*
local
,
int
prefix
,
int
scope
,
int
if_index
,
int
dad
,
int
scope
,
int
if_index
,
int
flags
,
int
preferred
,
int
valid
,
void
*
vparam
)
int
preferred
,
int
valid
,
void
*
vparam
)
{
{
struct
dhcp_lease
*
lease
;
struct
dhcp_lease
*
lease
;
(
void
)
scope
;
(
void
)
scope
;
(
void
)
dad
;
(
void
)
flags
;
(
void
)
preferred
;
(
void
)
preferred
;
(
void
)
valid
;
(
void
)
valid
;
...
...
src/netlink.c
View file @
bad7b875
...
@@ -239,6 +239,8 @@ int iface_enumerate(int family, void *parm, int (*callback)())
...
@@ -239,6 +239,8 @@ int iface_enumerate(int family, void *parm, int (*callback)())
{
{
struct
in6_addr
*
addrp
=
NULL
;
struct
in6_addr
*
addrp
=
NULL
;
u32
valid
=
0
,
preferred
=
0
;
u32
valid
=
0
,
preferred
=
0
;
int
flags
=
0
;
while
(
RTA_OK
(
rta
,
len1
))
while
(
RTA_OK
(
rta
,
len1
))
{
{
if
(
rta
->
rta_type
==
IFA_ADDRESS
)
if
(
rta
->
rta_type
==
IFA_ADDRESS
)
...
@@ -252,9 +254,15 @@ int iface_enumerate(int family, void *parm, int (*callback)())
...
@@ -252,9 +254,15 @@ int iface_enumerate(int family, void *parm, int (*callback)())
rta
=
RTA_NEXT
(
rta
,
len1
);
rta
=
RTA_NEXT
(
rta
,
len1
);
}
}
if
(
ifa
->
ifa_flags
&
IFA_F_TENTATIVE
)
flags
|=
IFACE_TENTATIVE
;
if
(
ifa
->
ifa_flags
&
IFA_F_DEPRECATED
)
flags
|=
IFACE_DEPRECATED
;
if
(
addrp
&&
callback_ok
)
if
(
addrp
&&
callback_ok
)
if
(
!
((
*
callback
)(
addrp
,
(
int
)(
ifa
->
ifa_prefixlen
),
(
int
)(
ifa
->
ifa_scope
),
if
(
!
((
*
callback
)(
addrp
,
(
int
)(
ifa
->
ifa_prefixlen
),
(
int
)(
ifa
->
ifa_scope
),
(
int
)(
ifa
->
ifa_index
),
(
int
)(
ifa
->
ifa_flags
&
IFA_F_TENTATIVE
)
,
(
int
)(
ifa
->
ifa_index
),
flags
,
(
int
)
preferred
,
(
int
)
valid
,
parm
)))
(
int
)
preferred
,
(
int
)
valid
,
parm
)))
callback_ok
=
0
;
callback_ok
=
0
;
}
}
...
...
src/network.c
View file @
bad7b875
...
@@ -291,7 +291,7 @@ static int iface_allowed(struct irec **irecp, int if_index,
...
@@ -291,7 +291,7 @@ static int iface_allowed(struct irec **irecp, int if_index,
#ifdef HAVE_IPV6
#ifdef HAVE_IPV6
static
int
iface_allowed_v6
(
struct
in6_addr
*
local
,
int
prefix
,
static
int
iface_allowed_v6
(
struct
in6_addr
*
local
,
int
prefix
,
int
scope
,
int
if_index
,
int
dad
,
int
scope
,
int
if_index
,
int
flags
,
int
preferred
,
int
valid
,
void
*
vparam
)
int
preferred
,
int
valid
,
void
*
vparam
)
{
{
union
mysockaddr
addr
;
union
mysockaddr
addr
;
...
@@ -312,7 +312,7 @@ static int iface_allowed_v6(struct in6_addr *local, int prefix,
...
@@ -312,7 +312,7 @@ static int iface_allowed_v6(struct in6_addr *local, int prefix,
addr
.
in6
.
sin6_port
=
htons
(
daemon
->
port
);
addr
.
in6
.
sin6_port
=
htons
(
daemon
->
port
);
addr
.
in6
.
sin6_scope_id
=
if_index
;
addr
.
in6
.
sin6_scope_id
=
if_index
;
return
iface_allowed
((
struct
irec
**
)
vparam
,
if_index
,
&
addr
,
netmask
,
dad
);
return
iface_allowed
((
struct
irec
**
)
vparam
,
if_index
,
&
addr
,
netmask
,
!!
(
flags
&
IFACE_TENTATIVE
)
);
}
}
#endif
#endif
...
...
src/radv.c
View file @
bad7b875
...
@@ -40,10 +40,10 @@ struct search_param {
...
@@ -40,10 +40,10 @@ struct search_param {
static
void
send_ra
(
time_t
now
,
int
iface
,
char
*
iface_name
,
struct
in6_addr
*
dest
);
static
void
send_ra
(
time_t
now
,
int
iface
,
char
*
iface_name
,
struct
in6_addr
*
dest
);
static
int
add_prefixes
(
struct
in6_addr
*
local
,
int
prefix
,
static
int
add_prefixes
(
struct
in6_addr
*
local
,
int
prefix
,
int
scope
,
int
if_index
,
int
dad
,
int
scope
,
int
if_index
,
int
flags
,
int
preferred
,
int
valid
,
void
*
vparam
);
int
preferred
,
int
valid
,
void
*
vparam
);
static
int
iface_search
(
struct
in6_addr
*
local
,
int
prefix
,
static
int
iface_search
(
struct
in6_addr
*
local
,
int
prefix
,
int
scope
,
int
if_index
,
int
dad
,
int
scope
,
int
if_index
,
int
flags
,
int
prefered
,
int
valid
,
void
*
vparam
);
int
prefered
,
int
valid
,
void
*
vparam
);
static
int
add_lla
(
int
index
,
unsigned
int
type
,
char
*
mac
,
size_t
maclen
,
void
*
parm
);
static
int
add_lla
(
int
index
,
unsigned
int
type
,
char
*
mac
,
size_t
maclen
,
void
*
parm
);
...
@@ -325,13 +325,13 @@ static void send_ra(time_t now, int iface, char *iface_name, struct in6_addr *de
...
@@ -325,13 +325,13 @@ static void send_ra(time_t now, int iface, char *iface_name, struct in6_addr *de
}
}
static
int
add_prefixes
(
struct
in6_addr
*
local
,
int
prefix
,
static
int
add_prefixes
(
struct
in6_addr
*
local
,
int
prefix
,
int
scope
,
int
if_index
,
int
dad
,
int
scope
,
int
if_index
,
int
flags
,
int
preferred
,
int
valid
,
void
*
vparam
)
int
preferred
,
int
valid
,
void
*
vparam
)
{
{
struct
ra_param
*
param
=
vparam
;
struct
ra_param
*
param
=
vparam
;
(
void
)
scope
;
/* warning */
(
void
)
scope
;
/* warning */
(
void
)
dad
;
(
void
)
flags
;
(
void
)
preferred
;
(
void
)
preferred
;
(
void
)
valid
;
(
void
)
valid
;
...
@@ -526,14 +526,13 @@ time_t periodic_ra(time_t now)
...
@@ -526,14 +526,13 @@ time_t periodic_ra(time_t now)
}
}
static
int
iface_search
(
struct
in6_addr
*
local
,
int
prefix
,
static
int
iface_search
(
struct
in6_addr
*
local
,
int
prefix
,
int
scope
,
int
if_index
,
int
dad
,
int
scope
,
int
if_index
,
int
flags
,
int
preferred
,
int
valid
,
void
*
vparam
)
int
preferred
,
int
valid
,
void
*
vparam
)
{
{
struct
search_param
*
param
=
vparam
;
struct
search_param
*
param
=
vparam
;
struct
dhcp_context
*
context
;
struct
dhcp_context
*
context
;
(
void
)
scope
;
(
void
)
scope
;
(
void
)
dad
;
(
void
)
preferred
;
(
void
)
preferred
;
(
void
)
valid
;
(
void
)
valid
;
...
@@ -549,7 +548,7 @@ static int iface_search(struct in6_addr *local, int prefix,
...
@@ -549,7 +548,7 @@ static int iface_search(struct in6_addr *local, int prefix,
timeout value and arrange for RA to be sent unless interface is
timeout value and arrange for RA to be sent unless interface is
still doing DAD.*/
still doing DAD.*/
if
(
!
dad
)
if
(
!
(
flags
&
IFACE_TENTATIVE
)
)
param
->
iface
=
if_index
;
param
->
iface
=
if_index
;
if
(
difftime
(
param
->
now
,
context
->
ra_short_period_start
)
<
60
.
0
)
if
(
difftime
(
param
->
now
,
context
->
ra_short_period_start
)
<
60
.
0
)
...
...
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