mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [BUG] TFTP: No access to subdirectories
@ 2017-09-03  8:49 Dennis Menschel
  2017-09-03 12:45 ` Antony Pavlov
  0 siblings, 1 reply; 7+ messages in thread
From: Dennis Menschel @ 2017-09-03  8:49 UTC (permalink / raw)
  To: barebox


[-- Attachment #1.1.1: Type: text/plain, Size: 8254 bytes --]

Hello,

I've noticed that since barebox version 2017.07.0, accessing files via TFTP only works for files that are located in the root directory of the TFTP server.
Accessing files that reside in subdirectories doesn't work anymore.
The bug affects both access via /mnt/tftp/ and via the tftp shell command.

I've tested the following versions of barebox:

- 2017.05.0: works
- 2017.06.0: works
- 2017.07.0: doesn't work anymore
- 2017.08.0: doesn't work anymore

Below follows the test scenario I've used to reproduce the bug:


Scenario
========

For the server, I'm using a Raspberry Pi 2 with:
- a DHCP server (isc-dhcp-server) and
- a TFTP server (tftpd-hpa).

For the client, I'm using a BeagleBone Black that runs barebox.

The server's IPv4 address is 192.168.2.82, while the client gets address 192.168.2.100.

Test files and directory structure on the TFTP server:
test-file-1.txt
test-dir-1/test-file-2.txt
test-dir-1/test-dir-2/test-file-3.txt


Network configuration of barebox
================================

barebox@TI AM335x BeagleBone black:/ dhcp
eth0: 100Mbps full duplex link detected
DHCP client bound to address 192.168.2.100
barebox@TI AM335x BeagleBone black:/ devinfo eth0 
Parameters: 
  ethaddr: ec:24:b8:9d:77:12 (type: MAC) 
  gateway: 0.0.0.0 (type: ipv4) 
  ipaddr: 192.168.2.100 (type: ipv4) 
  linux.bootargs:  (type: string) 
  netmask: 255.255.255.0 (type: ipv4) 
  serverip: 192.168.2.82 (type: ipv4) 


Behavior of barebox up to 2017.06.0
===================================

Access via /mnt/tftp
--------------------

barebox@TI AM335x BeagleBone black:/ cat /mnt/tftp/test-file-1.txt
This is from test-file-1.txt.
barebox@TI AM335x BeagleBone black:/ cat /mnt/tftp/test-dir-1/test-file-2.txt
This is from test-file-2.txt.
barebox@TI AM335x BeagleBone black:/ cat /mnt/tftp/test-dir-1/test-dir-2/test-file-3.txt
This is from test-file-3.txt.


Log entries of TFTP server
--------------------------

Aug 29 01:45:44 berry03 in.tftpd[5453]: RRQ from 192.168.2.100 filename test-file-1.txt
Aug 29 01:45:44 berry03 in.tftpd[5454]: RRQ from 192.168.2.100 filename test-file-1.txt
Aug 29 01:45:46 berry03 in.tftpd[5455]: RRQ from 192.168.2.100 filename test-dir-1
Aug 29 01:45:46 berry03 in.tftpd[5456]: RRQ from 192.168.2.100 filename test-dir-1/test-file-2.txt
Aug 29 01:45:46 berry03 in.tftpd[5457]: RRQ from 192.168.2.100 filename test-dir-1/test-file-2.txt
Aug 29 01:46:00 berry03 in.tftpd[5458]: RRQ from 192.168.2.100 filename test-dir-1/test-dir-2
Aug 29 01:46:00 berry03 in.tftpd[5459]: RRQ from 192.168.2.100 filename test-dir-1/test-dir-2/test-file-3.txt
Aug 29 01:46:00 berry03 in.tftpd[5460]: RRQ from 192.168.2.100 filename test-dir-1/test-dir-2/test-file-3.txt


Access via tftp command
-----------------------

barebox@TI AM335x BeagleBone black:/ tftp test-file-1.txt
        [#################################################################]
barebox@TI AM335x BeagleBone black:/ tftp test-dir-1/test-file-2.txt
        [#################################################################]
barebox@TI AM335x BeagleBone black:/ tftp test-dir-1/test-dir-2/test-file-3.txt
        [#################################################################]


Log entries of TFTP server
--------------------------

Aug 29 01:47:26 berry03 in.tftpd[5468]: RRQ from 192.168.2.100 filename test-file-1.txt
Aug 29 01:47:26 berry03 in.tftpd[5469]: RRQ from 192.168.2.100 filename test-file-1.txt
Aug 29 01:47:26 berry03 in.tftpd[5470]: RRQ from 192.168.2.100 filename test-file-1.txt
Aug 29 01:47:28 berry03 in.tftpd[5471]: RRQ from 192.168.2.100 filename test-dir-1/test-file-2.txt
Aug 29 01:47:28 berry03 in.tftpd[5472]: RRQ from 192.168.2.100 filename test-dir-1/test-file-2.txt
Aug 29 01:47:28 berry03 in.tftpd[5473]: RRQ from 192.168.2.100 filename test-dir-1/test-file-2.txt
Aug 29 01:47:38 berry03 in.tftpd[5474]: RRQ from 192.168.2.100 filename test-dir-1/test-dir-2/test-file-3.txt
Aug 29 01:47:38 berry03 in.tftpd[5475]: RRQ from 192.168.2.100 filename test-dir-1/test-dir-2/test-file-3.txt
Aug 29 01:47:38 berry03 in.tftpd[5476]: RRQ from 192.168.2.100 filename test-dir-1/test-dir-2/test-file-3.txt



Behavior of barebox since 2017.07.0
===================================


Access via /mnt/tftp
--------------------

barebox@TI AM335x BeagleBone black:/ cat /mnt/tftp/test-file-1.txt
This is from test-file-1.txt.
barebox@TI AM335x BeagleBone black:/ cat /mnt/tftp/test-dir-1/test-file-2.txt
could not open /mnt/tftp/test-dir-1/test-file-2.txt: Invalid argument
barebox@TI AM335x BeagleBone black:/ cat /mnt/tftp/test-dir-1/test-dir-2/test-file-3.txt
could not open /mnt/tftp/test-dir-1/test-dir-2/test-file-3.txt: Invalid argument


Log entries of TFTP server
--------------------------

Aug 29 02:11:01 berry03 in.tftpd[5517]: RRQ from 192.168.2.100 filename test-file-1.txt
Aug 29 02:11:01 berry03 in.tftpd[5518]: RRQ from 192.168.2.100 filename test-file-1.txt
Aug 29 02:11:01 berry03 in.tftpd[5519]: RRQ from 192.168.2.100 filename test-file-1.txt
Aug 29 02:11:01 berry03 in.tftpd[5520]: RRQ from 192.168.2.100 filename test-file-1.txt
Aug 29 02:11:38 berry03 in.tftpd[5521]: RRQ from 192.168.2.100 filename test-dir-1
Aug 29 02:11:38 berry03 in.tftpd[5522]: RRQ from 192.168.2.100 filename test-dir-1
Aug 29 02:11:38 berry03 in.tftpd[5523]: RRQ from 192.168.2.100 filename test-dir-1
Aug 29 02:11:38 berry03 in.tftpd[5524]: RRQ from 192.168.2.100 filename test-dir-1
Aug 29 02:11:38 berry03 in.tftpd[5525]: RRQ from 192.168.2.100 filename test-dir-1
Aug 29 02:11:38 berry03 in.tftpd[5526]: RRQ from 192.168.2.100 filename test-dir-1
Aug 29 02:11:58 berry03 in.tftpd[5527]: RRQ from 192.168.2.100 filename test-dir-1
Aug 29 02:11:58 berry03 in.tftpd[5528]: RRQ from 192.168.2.100 filename test-dir-1
Aug 29 02:11:58 berry03 in.tftpd[5529]: RRQ from 192.168.2.100 filename test-dir-1
Aug 29 02:11:58 berry03 in.tftpd[5530]: RRQ from 192.168.2.100 filename test-dir-1
Aug 29 02:11:58 berry03 in.tftpd[5531]: RRQ from 192.168.2.100 filename test-dir-1
Aug 29 02:11:58 berry03 in.tftpd[5532]: RRQ from 192.168.2.100 filename test-dir-1


Access via tftp command
-----------------------

barebox@TI AM335x BeagleBone black:/ tftp test-file-1.txt
        [#################################################################]
barebox@TI AM335x BeagleBone black:/ tftp test-dir-1/test-file-2.txt
could not open /.tftp_tmp_path/test-dir-1/test-file-2.txt: Invalid argument

barebox@TI AM335x BeagleBone black:/ tftp test-dir-1/test-dir-2/test-file-3.txt
could not open /.tftp_tmp_path/test-dir-1/test-dir-2/test-file-3.txt: Invalid argument



Log entries of TFTP server
--------------------------

Aug 29 02:13:27 berry03 in.tftpd[5534]: RRQ from 192.168.2.100 filename test-file-1.txt
Aug 29 02:13:27 berry03 in.tftpd[5535]: RRQ from 192.168.2.100 filename test-file-1.txt
Aug 29 02:13:27 berry03 in.tftpd[5536]: RRQ from 192.168.2.100 filename test-file-1.txt
Aug 29 02:13:27 berry03 in.tftpd[5537]: RRQ from 192.168.2.100 filename test-file-1.txt
Aug 29 02:13:27 berry03 in.tftpd[5538]: RRQ from 192.168.2.100 filename test-file-1.txt
Aug 29 02:13:27 berry03 in.tftpd[5539]: RRQ from 192.168.2.100 filename test-file-1.txt
Aug 29 02:13:39 berry03 in.tftpd[5540]: RRQ from 192.168.2.100 filename test-dir-1
Aug 29 02:13:39 berry03 in.tftpd[5541]: RRQ from 192.168.2.100 filename test-dir-1
Aug 29 02:13:39 berry03 in.tftpd[5542]: RRQ from 192.168.2.100 filename test-dir-1
Aug 29 02:14:05 berry03 in.tftpd[5543]: RRQ from 192.168.2.100 filename test-dir-1
Aug 29 02:14:05 berry03 in.tftpd[5544]: RRQ from 192.168.2.100 filename test-dir-1
Aug 29 02:14:05 berry03 in.tftpd[5545]: RRQ from 192.168.2.100 filename test-dir-1


Conclusion
==========

As can be seen from the log entries of the TFTP server, the access pattern of barebox has changed.
All of the attempts to access a subdirectory stop at "test-dir-1".
Furthermore, the number of accesses per file is different.
The timestamps indicate which requests belong to one file access attempt.

I hope this information helps.
Thanks in advance!

Best regards,
Dennis Menschel


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: [BUG] TFTP: No access to subdirectories
@ 2018-05-24  7:26 Franz Forstmayr
  2018-05-25  6:25 ` Sascha Hauer
  0 siblings, 1 reply; 7+ messages in thread
From: Franz Forstmayr @ 2018-05-24  7:26 UTC (permalink / raw)
  To: barebox

Hi,

I just saw this old thread and wanted to ask, if this one has been
fixed already? I just ran into a similar/same problem using
barebox-2018-04 from the  phytec repository
(https://git.phytec.de/barebox/log/?h=v2018.04.0-phy).

When i want to boot net the first time, it fails the second time successes.

barebox@Phytec phyCORE-i.MX6 Ultra Lite SOM:/ boot
booting 'net'
eth0: 100Mbps full duplex link detected
T open: Invalid argument
could not open /mnt/tftp/segin1/Image: Invalid argument
Booting 'net' failed: Invalid argument
booting 'net' failed: Invalid argument
boot: Invalid argument
barebox@Phytec phyCORE-i.MX6 Ultra Lite SOM:/ boot
booting 'net'

This is my /env/boot/net/

#!/bin/sh

[ -e /env/config-expansions ] && /env/config-expansions

path="/mnt/tftp/${global.hostname}"

global.bootm.image="${path}/Image"
global.bootm.oftree="${path}/oftree"

nfsroot="${nv.net.server}:/nfs/${global.hostname}"
global.linux.bootargs.base="ip=$nv.dev.eth0.ipaddr:$nv.net.server:$nv.net.gateway:$nv.dev.eth0.netmask::eth0:off"
global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=${nfsroot},vers=3"

My workaround is, to set up an md5sum global.bootm.oftree and for some
strange reason, the boot command successes.
Any thoughts?

Regards
Franz

Am 03.09.2017 um 14:45 schrieb Antony Pavlov:
> On Sun, 3 Sep 2017 10:49:21 +0200
> Dennis Menschel <menschel-d at posteo.de> wrote:
>
>> Hello,
>>
>> I've noticed that since barebox version 2017.07.0, accessing files via TFTP only works for files that are located in the root directory of the TFTP server.
>> Accessing files that reside in subdirectories doesn't work anymore.
>> The bug affects both access via /mnt/tftp/ and via the tftp shell command.
>>
>> I've tested the following versions of barebox:
>>
>> - 2017.05.0: works
>> - 2017.06.0: works
>> - 2017.07.0: doesn't work anymore
>> - 2017.08.0: doesn't work anymore
>>
>> Below follows the test scenario I've used to reproduce the bug:
>>
>>
>> Scenario
>> ========
>>
>> For the server, I'm using a Raspberry Pi 2 with:
>> - a DHCP server (isc-dhcp-server) and
>> - a TFTP server (tftpd-hpa).
>
> I have seen the same problem, please see this message:
>
> http://lists.infradead.org/pipermail/barebox/2017-July/030587.html
>
> I use tftpd-hpa too.
>
> I want to note again that reverting 944bf0e1 ('fixup! fs: Implement links to directories') and
> a602bebc ('fs: Implement links to directories') fixes the problem.
>
>> [...]

Thanks for the info, Antony!

I must admit that I was only searching the mailing list archive for the
subject concerning "bug" or "tftp", but not the content of the residual
mails before I wrote my bug report.

Good to see that you've already found that commits that cause the
problem. Hopefully it will be fixed in one of the next releases.

Best regards,
Dennis Menschel

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-05-25  9:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-03  8:49 [BUG] TFTP: No access to subdirectories Dennis Menschel
2017-09-03 12:45 ` Antony Pavlov
2017-09-03 18:28   ` Dennis Menschel
2018-05-24  7:26 Franz Forstmayr
2018-05-25  6:25 ` Sascha Hauer
2018-05-25  6:53   ` Franz Forstmayr
2018-05-25  9:06     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox