diff options
author | Simon Glass <sjg@chromium.org> | 2011-10-26 14:18:38 +0000 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2011-10-27 23:53:57 +0200 |
commit | 39bccd21d0c838242fb86bceda759e5640d4d683 (patch) | |
tree | d3ca88c491ec71a1b3df6fc7f383d4f2321b4a1a /net/tftp.c | |
parent | 206d68fdd41e4942825cfc4a91a096297b654a24 (diff) | |
download | u-boot-imx-39bccd21d0c838242fb86bceda759e5640d4d683.zip u-boot-imx-39bccd21d0c838242fb86bceda759e5640d4d683.tar.gz u-boot-imx-39bccd21d0c838242fb86bceda759e5640d4d683.tar.bz2 |
net: Hide more code behind CONFIG_CMD_TFTPPUT
This commit reduces code size a little by making the ICMP handler only
available to tftpput. This is reasonable since it is the only user at
present (ping just uses the normal handler).
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'net/tftp.c')
-rw-r--r-- | net/tftp.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -421,7 +421,7 @@ TftpSend(void) TftpOurPort, len); } - +#ifdef CONFIG_CMD_TFTPPUT static void icmp_handler(unsigned type, unsigned code, unsigned dest, IPaddr_t sip, unsigned src, uchar *pkt, unsigned len) { @@ -430,6 +430,7 @@ static void icmp_handler(unsigned type, unsigned code, unsigned dest, restart("TFTP server died"); } } +#endif static void TftpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src, @@ -771,8 +772,9 @@ void TftpStart(enum proto_t protocol) NetSetTimeout(TftpTimeoutMSecs, TftpTimeout); NetSetHandler(TftpHandler); +#ifdef CONFIG_CMD_TFTPPUT net_set_icmp_handler(icmp_handler); - +#endif TftpRemotePort = WELL_KNOWN_PORT; TftpTimeoutCount = 0; /* Use a pseudo-random port unless a specific port is set */ |