Skip to content

Commit

Permalink
tftp: Report server IP address on debug message
Browse files Browse the repository at this point in the history
When debugging, it is very useful to get the ip adress of the server
that reponsded to that packet.
  • Loading branch information
ErwanAliasr1 committed Sep 4, 2015
1 parent d0fde22 commit 6610592
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion core/fs/pxe/tftp.c
Expand Up @@ -259,7 +259,16 @@ void tftp_open(struct url_info *url, int flags, struct inode *inode,
} 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],
((uint8_t *)&url->ip)[0],
((uint8_t *)&url->ip)[1],
((uint8_t *)&url->ip)[2],
((uint8_t *)&url->ip)[3]);
if ((src_ip == url->ip) && (buf_len >= 2))
break;
}
Expand Down

0 comments on commit 6610592

Please sign in to comment.