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
d0e2c6c9
Commit
d0e2c6c9
authored
Mar 12, 2012
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decode DHCPv4 T1, T2 and lease-time options better.
parent
8643ec7f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
src/option.c
src/option.c
+14
-4
No files found.
src/option.c
View file @
d0e2c6c9
...
@@ -375,6 +375,7 @@ static struct {
...
@@ -375,6 +375,7 @@ static struct {
#define OT_INTERNAL 0x2000
#define OT_INTERNAL 0x2000
#define OT_NAME 0x1000
#define OT_NAME 0x1000
#define OT_CSTRING 0x0800
#define OT_CSTRING 0x0800
#define OT_DEC 0x0400
/* OT_INTERNAL only */
static
const
struct
opttab_t
{
static
const
struct
opttab_t
{
char
*
name
;
char
*
name
;
...
@@ -419,15 +420,15 @@ static const struct opttab_t {
...
@@ -419,15 +420,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
},
{
"lease-time"
,
51
,
OT_INTERNAL
|
OT_DEC
},
{
"option-overload"
,
52
,
OT_INTERNAL
},
{
"option-overload"
,
52
,
OT_INTERNAL
},
{
"message-type"
,
53
,
OT_INTERNAL
,
},
{
"message-type"
,
53
,
OT_INTERNAL
,
},
{
"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
},
{
"T1"
,
58
,
OT_INTERNAL
|
OT_DEC
},
{
"T2"
,
59
,
OT_INTERNAL
},
{
"T2"
,
59
,
OT_INTERNAL
|
OT_DEC
},
{
"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
},
...
@@ -574,6 +575,15 @@ char *option_string(int prot, unsigned int opt, unsigned char *val, int opt_len,
...
@@ -574,6 +575,15 @@ 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
)
{
unsigned
int
dec
=
0
;
for
(
i
=
0
;
i
<
opt_len
;
i
++
)
dec
=
(
dec
<<
8
)
|
val
[
i
];
sprintf
(
buf
,
"%u"
,
dec
);
}
else
else
nodecode
=
1
;
nodecode
=
1
;
}
}
...
...
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