summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/lwip/lwip/src/apps/tftp/tftp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/lwip/lwip/src/apps/tftp/tftp.c b/lib/lwip/lwip/src/apps/tftp/tftp.c
index ddfdbfc0c1b..74fc1fbe586 100644
--- a/lib/lwip/lwip/src/apps/tftp/tftp.c
+++ b/lib/lwip/lwip/src/apps/tftp/tftp.c
@@ -454,10 +454,12 @@ tftp_init_common(u8_t mode, const struct tftp_context *ctx)
return ERR_MEM;
}
- ret = udp_bind(pcb, IP_ANY_TYPE, TFTP_PORT);
- if (ret != ERR_OK) {
- udp_remove(pcb);
- return ret;
+ if (mode == LWIP_TFTP_MODE_SERVER) {
+ ret = udp_bind(pcb, IP_ANY_TYPE, TFTP_PORT);
+ if (ret != ERR_OK) {
+ udp_remove(pcb);
+ return ret;
+ }
}
tftp_state.handle = NULL;