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
23245c0c
Commit
23245c0c
authored
Jul 18, 2012
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RFC 4242 support.
parent
b271446f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
9 deletions
+49
-9
CHANGELOG
CHANGELOG
+5
-0
dnsmasq.conf.example
dnsmasq.conf.example
+3
-0
src/dhcp-common.c
src/dhcp-common.c
+9
-5
src/dnsmasq.h
src/dnsmasq.h
+1
-1
src/option.c
src/option.c
+31
-3
No files found.
CHANGELOG
View file @
23245c0c
...
@@ -54,6 +54,11 @@ version 2.62
...
@@ -54,6 +54,11 @@ version 2.62
two addresses in the same network. Thanks to Jim Bos for
two addresses in the same network. Thanks to Jim Bos for
his help nailing this.
his help nailing this.
Teach DHCPv6 about the RFC 4242 information-refresh-time
option, and add parsing if the minutes, hours and days
format for options. Thanks to Francois-Xavier Le Bail for
the suggestion.
version 2.61
version 2.61
Re-write interface discovery code on *BSD to use
Re-write interface discovery code on *BSD to use
...
...
dnsmasq.conf.example
View file @
23245c0c
...
@@ -326,6 +326,9 @@
...
@@ -326,6 +326,9 @@
# dnsmasq and another.
# dnsmasq and another.
#dhcp-option=option6:dns-server,[::],[1234::88]
#dhcp-option=option6:dns-server,[::],[1234::88]
# Ask client to poll for option changes every six hours. (RFC4242)
#dhcp-option=option6:information-refresh-time,6h
# Set the NTP time server address to be the same machine as
# Set the NTP time server address to be the same machine as
# is running dnsmasq
# is running dnsmasq
#dhcp-option=42,0.0.0.0
#dhcp-option=42,0.0.0.0
...
...
src/dhcp-common.c
View file @
23245c0c
...
@@ -487,15 +487,15 @@ static const struct opttab_t {
...
@@ -487,15 +487,15 @@ static const struct opttab_t {
{
"x-windows-fs"
,
48
,
OT_ADDR_LIST
},
{
"x-windows-fs"
,
48
,
OT_ADDR_LIST
},
{
"x-windows-dm"
,
49
,
OT_ADDR_LIST
},
{
"x-windows-dm"
,
49
,
OT_ADDR_LIST
},
{
"requested-address"
,
50
,
OT_INTERNAL
|
OT_ADDR_LIST
},
{
"requested-address"
,
50
,
OT_INTERNAL
|
OT_ADDR_LIST
},
{
"lease-time"
,
51
,
OT_INTERNAL
|
OT_
DEC
},
{
"lease-time"
,
51
,
OT_INTERNAL
|
OT_
TIME
},
{
"option-overload"
,
52
,
OT_INTERNAL
},
{
"option-overload"
,
52
,
OT_INTERNAL
},
{
"message-type"
,
53
,
OT_INTERNAL
|
OT_DEC
},
{
"message-type"
,
53
,
OT_INTERNAL
|
OT_DEC
},
{
"server-identifier"
,
54
,
OT_INTERNAL
|
OT_ADDR_LIST
},
{
"server-identifier"
,
54
,
OT_INTERNAL
|
OT_ADDR_LIST
},
{
"parameter-request"
,
55
,
OT_INTERNAL
},
{
"parameter-request"
,
55
,
OT_INTERNAL
},
{
"message"
,
56
,
OT_INTERNAL
},
{
"message"
,
56
,
OT_INTERNAL
},
{
"max-message-size"
,
57
,
OT_INTERNAL
},
{
"max-message-size"
,
57
,
OT_INTERNAL
},
{
"T1"
,
58
,
OT_INTERNAL
|
OT_
DEC
},
{
"T1"
,
58
,
OT_INTERNAL
|
OT_
TIME
},
{
"T2"
,
59
,
OT_INTERNAL
|
OT_
DEC
},
{
"T2"
,
59
,
OT_INTERNAL
|
OT_
TIME
},
{
"vendor-class"
,
60
,
0
},
{
"vendor-class"
,
60
,
0
},
{
"client-id"
,
61
,
OT_INTERNAL
},
{
"client-id"
,
61
,
OT_INTERNAL
},
{
"nis+-domain"
,
64
,
OT_NAME
},
{
"nis+-domain"
,
64
,
OT_NAME
},
...
@@ -546,6 +546,7 @@ static const struct opttab_t opttab6[] = {
...
@@ -546,6 +546,7 @@ static const struct opttab_t opttab6[] = {
{
"nis-domain"
,
29
,
OT_RFC1035_NAME
},
{
"nis-domain"
,
29
,
OT_RFC1035_NAME
},
{
"nis+-domain"
,
30
,
OT_RFC1035_NAME
},
{
"nis+-domain"
,
30
,
OT_RFC1035_NAME
},
{
"sntp-server"
,
31
,
OT_ADDR_LIST
},
{
"sntp-server"
,
31
,
OT_ADDR_LIST
},
{
"information-refresh-time"
,
32
,
OT_TIME
},
{
"FQDN"
,
39
,
OT_INTERNAL
|
OT_RFC1035_NAME
},
{
"FQDN"
,
39
,
OT_INTERNAL
|
OT_RFC1035_NAME
},
{
"ntp-server"
,
56
,
OT_ADDR_LIST
},
{
"ntp-server"
,
56
,
OT_ADDR_LIST
},
{
"bootfile-url"
,
59
,
OT_NAME
},
{
"bootfile-url"
,
59
,
OT_NAME
},
...
@@ -710,14 +711,17 @@ char *option_string(int prot, unsigned int opt, unsigned char *val, int opt_len,
...
@@ -710,14 +711,17 @@ char *option_string(int prot, unsigned int opt, unsigned char *val, int opt_len,
}
}
}
}
#endif
#endif
else
if
((
ot
[
o
].
size
&
OT_DEC
)
&&
opt_len
!=
0
)
else
if
((
ot
[
o
].
size
&
(
OT_DEC
|
OT_TIME
)
)
&&
opt_len
!=
0
)
{
{
unsigned
int
dec
=
0
;
unsigned
int
dec
=
0
;
for
(
i
=
0
;
i
<
opt_len
;
i
++
)
for
(
i
=
0
;
i
<
opt_len
;
i
++
)
dec
=
(
dec
<<
8
)
|
val
[
i
];
dec
=
(
dec
<<
8
)
|
val
[
i
];
sprintf
(
buf
,
"%u"
,
dec
);
if
(
ot
[
o
].
size
&
OT_TIME
)
prettyprint_time
(
buf
,
dec
);
else
sprintf
(
buf
,
"%u"
,
dec
);
}
}
else
else
nodecode
=
1
;
nodecode
=
1
;
...
...
src/dnsmasq.h
View file @
23245c0c
...
@@ -475,7 +475,7 @@ struct frec {
...
@@ -475,7 +475,7 @@ struct frec {
#define OT_NAME 0x1000
#define OT_NAME 0x1000
#define OT_CSTRING 0x0800
#define OT_CSTRING 0x0800
#define OT_DEC 0x0400
#define OT_DEC 0x0400
#define OT_TIME 0x0200
/* actions in the daemon->helper RPC */
/* actions in the daemon->helper RPC */
#define ACTION_DEL 1
#define ACTION_DEL 1
...
...
src/option.c
View file @
23245c0c
...
@@ -764,7 +764,7 @@ static int parse_dhcp_opt(char *errstr, char *arg, int flags)
...
@@ -764,7 +764,7 @@ static int parse_dhcp_opt(char *errstr, char *arg, int flags)
}
}
else
if
(
c
==
'.'
)
else
if
(
c
==
'.'
)
{
{
is_addr6
=
is_dec
=
is_hex
=
0
;
is_addr6
=
is_dec
=
is_hex
=
0
;
dots
++
;
dots
++
;
}
}
else
if
(
c
==
'-'
)
else
if
(
c
==
'-'
)
...
@@ -811,8 +811,36 @@ static int parse_dhcp_opt(char *errstr, char *arg, int flags)
...
@@ -811,8 +811,36 @@ static int parse_dhcp_opt(char *errstr, char *arg, int flags)
/* or names */
/* or names */
else
if
(
opt_len
&
(
OT_NAME
|
OT_RFC1035_NAME
|
OT_CSTRING
))
else
if
(
opt_len
&
(
OT_NAME
|
OT_RFC1035_NAME
|
OT_CSTRING
))
is_addr6
=
is_addr
=
is_dec
=
is_hex
=
0
;
is_addr6
=
is_addr
=
is_dec
=
is_hex
=
0
;
if
(
is_hex
&&
digs
>
1
)
if
(
found_dig
&&
(
opt_len
&
OT_TIME
)
&&
strlen
(
comma
)
>
0
)
{
int
val
,
fac
=
1
;
switch
(
comma
[
strlen
(
comma
)
-
1
])
{
case
'd'
:
case
'D'
:
fac
*=
24
;
/* fall though */
case
'h'
:
case
'H'
:
fac
*=
60
;
/* fall through */
case
'm'
:
case
'M'
:
fac
*=
60
;
/* fall through */
case
's'
:
case
'S'
:
comma
[
strlen
(
comma
)
-
1
]
=
0
;
}
new
->
len
=
4
;
new
->
val
=
opt_malloc
(
4
);
val
=
atoi
(
comma
);
*
((
int
*
)
new
->
val
)
=
htonl
(
val
*
fac
);
}
else
if
(
is_hex
&&
digs
>
1
)
{
{
new
->
len
=
digs
;
new
->
len
=
digs
;
new
->
val
=
opt_malloc
(
new
->
len
);
new
->
val
=
opt_malloc
(
new
->
len
);
...
...
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