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
bec366b4
Commit
bec366b4
authored
Feb 24, 2016
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --tftp-mtu option.
parent
e06e6e34
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
4 deletions
+30
-4
CHANGELOG
CHANGELOG
+4
-0
man/dnsmasq.8
man/dnsmasq.8
+4
-0
src/dnsmasq.h
src/dnsmasq.h
+1
-1
src/option.c
src/option.c
+9
-1
src/tftp.c
src/tftp.c
+12
-2
No files found.
CHANGELOG
View file @
bec366b4
...
@@ -53,6 +53,10 @@ version 2.76
...
@@ -53,6 +53,10 @@ version 2.76
Add --dhcp-ttl option.
Add --dhcp-ttl option.
Add --tftp-mtu option. Thanks to Patrick McLean for the
initial patch.
version 2.75
version 2.75
Fix reversion on 2.74 which caused 100% CPU use when a
Fix reversion on 2.74 which caused 100% CPU use when a
dhcp-script is configured. Thanks to Adrian Davey for
dhcp-script is configured. Thanks to Adrian Davey for
...
...
man/dnsmasq.8
View file @
bec366b4
...
@@ -1810,6 +1810,10 @@ require about (2*n) + 10 descriptors. If
...
@@ -1810,6 +1810,10 @@ require about (2*n) + 10 descriptors. If
.B --tftp-port-range
.B --tftp-port-range
is given, that can affect the number of concurrent connections.
is given, that can affect the number of concurrent connections.
.TP
.TP
.B --tftp-mtu=<mtu size>
Use size as the ceiling of the MTU supported by the intervening network when
negotiating TFTP blocksize, overriding the MTU setting of the local interface if it is larger.
.TP
.B --tftp-no-blocksize
.B --tftp-no-blocksize
Stop the TFTP server from negotiating the "blocksize" option with a
Stop the TFTP server from negotiating the "blocksize" option with a
client. Some buggy clients request this option but then behave badly
client. Some buggy clients request this option but then behave badly
...
...
src/dnsmasq.h
View file @
bec366b4
...
@@ -975,7 +975,7 @@ extern struct daemon {
...
@@ -975,7 +975,7 @@ extern struct daemon {
struct
dhcp_netid_list
*
dhcp_ignore
,
*
dhcp_ignore_names
,
*
dhcp_gen_names
;
struct
dhcp_netid_list
*
dhcp_ignore
,
*
dhcp_ignore_names
,
*
dhcp_gen_names
;
struct
dhcp_netid_list
*
force_broadcast
,
*
bootp_dynamic
;
struct
dhcp_netid_list
*
force_broadcast
,
*
bootp_dynamic
;
struct
hostsfile
*
dhcp_hosts_file
,
*
dhcp_opts_file
,
*
dynamic_dirs
;
struct
hostsfile
*
dhcp_hosts_file
,
*
dhcp_opts_file
,
*
dynamic_dirs
;
int
dhcp_max
,
tftp_max
;
int
dhcp_max
,
tftp_max
,
tftp_mtu
;
int
dhcp_server_port
,
dhcp_client_port
;
int
dhcp_server_port
,
dhcp_client_port
;
int
start_tftp_port
,
end_tftp_port
;
int
start_tftp_port
,
end_tftp_port
;
unsigned
int
min_leasetime
;
unsigned
int
min_leasetime
;
...
...
src/option.c
View file @
bec366b4
...
@@ -158,7 +158,8 @@ struct myoption {
...
@@ -158,7 +158,8 @@ struct myoption {
#define LOPT_CPE_ID 346
#define LOPT_CPE_ID 346
#define LOPT_SCRIPT_ARP 347
#define LOPT_SCRIPT_ARP 347
#define LOPT_DHCPTTL 348
#define LOPT_DHCPTTL 348
#define LOPT_TFTP_MTU 349
#ifdef HAVE_GETOPT_LONG
#ifdef HAVE_GETOPT_LONG
static
const
struct
option
opts
[]
=
static
const
struct
option
opts
[]
=
#else
#else
...
@@ -244,6 +245,7 @@ static const struct myoption opts[] =
...
@@ -244,6 +245,7 @@ static const struct myoption opts[] =
{
"tftp-unique-root"
,
0
,
0
,
LOPT_APREF
},
{
"tftp-unique-root"
,
0
,
0
,
LOPT_APREF
},
{
"tftp-root"
,
1
,
0
,
LOPT_PREFIX
},
{
"tftp-root"
,
1
,
0
,
LOPT_PREFIX
},
{
"tftp-max"
,
1
,
0
,
LOPT_TFTP_MAX
},
{
"tftp-max"
,
1
,
0
,
LOPT_TFTP_MAX
},
{
"tftp-mtu"
,
1
,
0
,
LOPT_TFTP_MTU
},
{
"tftp-lowercase"
,
0
,
0
,
LOPT_TFTP_LC
},
{
"tftp-lowercase"
,
0
,
0
,
LOPT_TFTP_LC
},
{
"ptr-record"
,
1
,
0
,
LOPT_PTR
},
{
"ptr-record"
,
1
,
0
,
LOPT_PTR
},
{
"naptr-record"
,
1
,
0
,
LOPT_NAPTR
},
{
"naptr-record"
,
1
,
0
,
LOPT_NAPTR
},
...
@@ -432,6 +434,7 @@ static struct {
...
@@ -432,6 +434,7 @@ static struct {
{
LOPT_SECURE
,
OPT_TFTP_SECURE
,
NULL
,
gettext_noop
(
"Allow access only to files owned by the user running dnsmasq."
),
NULL
},
{
LOPT_SECURE
,
OPT_TFTP_SECURE
,
NULL
,
gettext_noop
(
"Allow access only to files owned by the user running dnsmasq."
),
NULL
},
{
LOPT_TFTP_NO_FAIL
,
OPT_TFTP_NO_FAIL
,
NULL
,
gettext_noop
(
"Do not terminate the service if TFTP directories are inaccessible."
),
NULL
},
{
LOPT_TFTP_NO_FAIL
,
OPT_TFTP_NO_FAIL
,
NULL
,
gettext_noop
(
"Do not terminate the service if TFTP directories are inaccessible."
),
NULL
},
{
LOPT_TFTP_MAX
,
ARG_ONE
,
"<integer>"
,
gettext_noop
(
"Maximum number of conncurrent TFTP transfers (defaults to %s)."
),
"#"
},
{
LOPT_TFTP_MAX
,
ARG_ONE
,
"<integer>"
,
gettext_noop
(
"Maximum number of conncurrent TFTP transfers (defaults to %s)."
),
"#"
},
{
LOPT_TFTP_MTU
,
ARG_ONE
,
"<integer>"
,
gettext_noop
(
"Maximum MTU to use for TFTP transfers."
),
NULL
},
{
LOPT_NOBLOCK
,
OPT_TFTP_NOBLOCK
,
NULL
,
gettext_noop
(
"Disable the TFTP blocksize extension."
),
NULL
},
{
LOPT_NOBLOCK
,
OPT_TFTP_NOBLOCK
,
NULL
,
gettext_noop
(
"Disable the TFTP blocksize extension."
),
NULL
},
{
LOPT_TFTP_LC
,
OPT_TFTP_LC
,
NULL
,
gettext_noop
(
"Convert TFTP filenames to lowercase"
),
NULL
},
{
LOPT_TFTP_LC
,
OPT_TFTP_LC
,
NULL
,
gettext_noop
(
"Convert TFTP filenames to lowercase"
),
NULL
},
{
LOPT_TFTPPORTS
,
ARG_ONE
,
"<start>,<end>"
,
gettext_noop
(
"Ephemeral port range for use by TFTP transfers."
),
NULL
},
{
LOPT_TFTPPORTS
,
ARG_ONE
,
"<start>,<end>"
,
gettext_noop
(
"Ephemeral port range for use by TFTP transfers."
),
NULL
},
...
@@ -2625,6 +2628,11 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
...
@@ -2625,6 +2628,11 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
ret_err
(
gen_err
);
ret_err
(
gen_err
);
break
;
break
;
case
LOPT_TFTP_MTU
:
/* --tftp-mtu */
if
(
!
atoi_check
(
arg
,
&
daemon
->
tftp_mtu
))
ret_err
(
gen_err
);
break
;
case
LOPT_PREFIX
:
/* --tftp-prefix */
case
LOPT_PREFIX
:
/* --tftp-prefix */
comma
=
split
(
arg
);
comma
=
split
(
arg
);
if
(
comma
)
if
(
comma
)
...
...
src/tftp.c
View file @
bec366b4
...
@@ -103,8 +103,10 @@ void tftp_request(struct listener *listen, time_t now)
...
@@ -103,8 +103,10 @@ void tftp_request(struct listener *listen, time_t now)
if
(
listen
->
iface
)
if
(
listen
->
iface
)
{
{
addr
=
listen
->
iface
->
addr
;
addr
=
listen
->
iface
->
addr
;
mtu
=
listen
->
iface
->
mtu
;
name
=
listen
->
iface
->
name
;
name
=
listen
->
iface
->
name
;
mtu
=
listen
->
iface
->
mtu
;
if
(
daemon
->
tftp_mtu
!=
0
&&
daemon
->
tftp_mtu
<
mtu
)
mtu
=
daemon
->
tftp_mtu
;
}
}
else
else
{
{
...
@@ -234,9 +236,17 @@ void tftp_request(struct listener *listen, time_t now)
...
@@ -234,9 +236,17 @@ void tftp_request(struct listener *listen, time_t now)
strncpy
(
ifr
.
ifr_name
,
name
,
IF_NAMESIZE
);
strncpy
(
ifr
.
ifr_name
,
name
,
IF_NAMESIZE
);
if
(
ioctl
(
listen
->
tftpfd
,
SIOCGIFMTU
,
&
ifr
)
!=
-
1
)
if
(
ioctl
(
listen
->
tftpfd
,
SIOCGIFMTU
,
&
ifr
)
!=
-
1
)
mtu
=
ifr
.
ifr_mtu
;
{
mtu
=
ifr
.
ifr_mtu
;
if
(
daemon
->
tftp_mtu
!=
0
&&
daemon
->
tftp_mtu
<
mtu
)
mtu
=
daemon
->
tftp_mtu
;
}
}
}
/* Failed to get interface mtu - can use configured value. */
if
(
mtu
==
0
)
mtu
=
daemon
->
tftp_mtu
;
if
(
name
)
if
(
name
)
{
{
/* check for per-interface prefix */
/* check for per-interface prefix */
...
...
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