Geert Stappers
2015-Sep-04 20:28 UTC
[syslinux] [syslinux:master] tftp: Report server IP address on debug message
On Fri, Sep 04, 2015 at 09:15:07AM -0700, syslinux-bot for Erwan Velu wrote:> Commit-ID: 66105926f3d748de827eb863913171efb9624165 > Gitweb: http://www.syslinux.org/commit/66105926f3d748de827eb863913171efb9624165 > Author: Erwan Velu <erwanaliasr1 at gmail.com> > AuthorDate: Wed, 2 Sep 2015 18:26:37 +0200 > Committer: Erwan Velu <erwanaliasr1 at gmail.com> > CommitDate: Fri, 4 Sep 2015 17:57:52 +0200 > > tftp: Report server IP address on debug message > > When debugging, it is very useful to get the ip adress of the server > that reponsded to that packet. > > --- > core/fs/pxe/tftp.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/core/fs/pxe/tftp.c b/core/fs/pxe/tftp.c > index 446da63..113ede2 100644 > --- a/core/fs/pxe/tftp.c > +++ b/core/fs/pxe/tftp.c > @@ -259,7 +259,16 @@ wait_pkt: > } else { > /* Make sure the packet actually came from the server and > is long enough for a TFTP opcode */ > - dprintf("tftp_open: got packet buflen=%d\n", buf_len); > + dprintf("tftp_open: got packet buflen=%d from server %u.%u.%u.%u(%u.%u.%u.%u)\n", > + buf_len, > + ((uint8_t *)&src_ip)[0], > + ((uint8_t *)&src_ip)[1], > + ((uint8_t *)&src_ip)[2], > + ((uint8_t *)&src_ip)[3],Most likely the TFTP server> + ((uint8_t *)&url->ip)[0], > + ((uint8_t *)&url->ip)[1], > + ((uint8_t *)&url->ip)[2], > + ((uint8_t *)&url->ip)[3]);What is that?> if ((src_ip == url->ip) && (buf_len >= 2)) > break; > } > _______________________________________________ > Syslinux-commits mailing list > Syslinux-commits at zytor.com > http://www.zytor.com/mailman/listinfo/syslinux-commitsGroeten Geert Stappers -- Leven en laten leven
Gene Cumm
2015-Sep-05 10:41 UTC
[syslinux] [syslinux:master] tftp: Report server IP address on debug message
On Fri, Sep 4, 2015 at 4:28 PM, Geert Stappers via Syslinux <syslinux at zytor.com> wrote:> On Fri, Sep 04, 2015 at 09:15:07AM -0700, syslinux-bot for Erwan Velu wrote: >> Commit-ID: 66105926f3d748de827eb863913171efb9624165 >> Gitweb: http://www.syslinux.org/commit/66105926f3d748de827eb863913171efb9624165 >> Author: Erwan Velu <erwanaliasr1 at gmail.com> >> AuthorDate: Wed, 2 Sep 2015 18:26:37 +0200 >> Committer: Erwan Velu <erwanaliasr1 at gmail.com> >> CommitDate: Fri, 4 Sep 2015 17:57:52 +0200 >> >> tftp: Report server IP address on debug message >> >> When debugging, it is very useful to get the ip adress of the server >> that reponsded to that packet. >> >> --- >> core/fs/pxe/tftp.c | 11 ++++++++++- >> 1 file changed, 10 insertions(+), 1 deletion(-) >> >> diff --git a/core/fs/pxe/tftp.c b/core/fs/pxe/tftp.c >> index 446da63..113ede2 100644 >> --- a/core/fs/pxe/tftp.c >> +++ b/core/fs/pxe/tftp.c >> @@ -259,7 +259,16 @@ wait_pkt: >> } else { >> /* Make sure the packet actually came from the server and >> is long enough for a TFTP opcode */ >> - dprintf("tftp_open: got packet buflen=%d\n", buf_len); >> + dprintf("tftp_open: got packet buflen=%d from server %u.%u.%u.%u(%u.%u.%u.%u)\n", >> + buf_len, >> + ((uint8_t *)&src_ip)[0], >> + ((uint8_t *)&src_ip)[1], >> + ((uint8_t *)&src_ip)[2], >> + ((uint8_t *)&src_ip)[3], > > Most likely the TFTP serverThe source IP in the packet.>> + ((uint8_t *)&url->ip)[0], >> + ((uint8_t *)&url->ip)[1], >> + ((uint8_t *)&url->ip)[2], >> + ((uint8_t *)&url->ip)[3]); > > What is that?The IP that we want to talk with. url should be the URL of the file we want to open. The two should match. -- -Gene>> if ((src_ip == url->ip) && (buf_len >= 2)) >> break; >> }
Erwan Velu
2015-Sep-05 12:17 UTC
[syslinux] [syslinux:master] tftp: Report server IP address on debug message
It is supposed to match but sometimes it doesn't; I had the case where I contacted my local server on my public adress and responded from the loopback. So it was the same server from two different addresses which confused then the rest of the code. By adding this print I was able to get the situation immediately and fixed it. That's why I added that information on the debug print. 2015-09-05 12:41 GMT+02:00 Gene Cumm <gene.cumm at gmail.com>:> On Fri, Sep 4, 2015 at 4:28 PM, Geert Stappers via Syslinux > <syslinux at zytor.com> wrote: > > On Fri, Sep 04, 2015 at 09:15:07AM -0700, syslinux-bot for Erwan Velu > wrote: > >> Commit-ID: 66105926f3d748de827eb863913171efb9624165 > >> Gitweb: > http://www.syslinux.org/commit/66105926f3d748de827eb863913171efb9624165 > >> Author: Erwan Velu <erwanaliasr1 at gmail.com> > >> AuthorDate: Wed, 2 Sep 2015 18:26:37 +0200 > >> Committer: Erwan Velu <erwanaliasr1 at gmail.com> > >> CommitDate: Fri, 4 Sep 2015 17:57:52 +0200 > >> > >> tftp: Report server IP address on debug message > >> > >> When debugging, it is very useful to get the ip adress of the server > >> that reponsded to that packet. > >> > >> --- > >> core/fs/pxe/tftp.c | 11 ++++++++++- > >> 1 file changed, 10 insertions(+), 1 deletion(-) > >> > >> diff --git a/core/fs/pxe/tftp.c b/core/fs/pxe/tftp.c > >> index 446da63..113ede2 100644 > >> --- a/core/fs/pxe/tftp.c > >> +++ b/core/fs/pxe/tftp.c > >> @@ -259,7 +259,16 @@ wait_pkt: > >> } else { > >> /* Make sure the packet actually came from the server and > >> is long enough for a TFTP opcode */ > >> - dprintf("tftp_open: got packet buflen=%d\n", buf_len); > >> + dprintf("tftp_open: got packet buflen=%d from server > %u.%u.%u.%u(%u.%u.%u.%u)\n", > >> + buf_len, > >> + ((uint8_t *)&src_ip)[0], > >> + ((uint8_t *)&src_ip)[1], > >> + ((uint8_t *)&src_ip)[2], > >> + ((uint8_t *)&src_ip)[3], > > > > Most likely the TFTP server > > The source IP in the packet. > > >> + ((uint8_t *)&url->ip)[0], > >> + ((uint8_t *)&url->ip)[1], > >> + ((uint8_t *)&url->ip)[2], > >> + ((uint8_t *)&url->ip)[3]); > > > > What is that? > > The IP that we want to talk with. url should be the URL of the file > we want to open. The two should match. > > -- > -Gene > > > >> if ((src_ip == url->ip) && (buf_len >= 2)) > >> break; > >> } >
Seemingly Similar Threads
- [syslinux:master] tftp: Report server IP address on debug message
- [syslinux:master] tftp: Report server IP address on debug message
- [PATCH] core: Bad read of file size over TFTP
- [PATCH] Updated udp.c to use real client ip and subnetmask values if on local subnet
- PXE Error Reporting