Skip to content

Commit

Permalink
Fix: packet size and typo
Browse files Browse the repository at this point in the history
  • Loading branch information
DipSwitch committed Dec 3, 2015
1 parent 274e211 commit ef62d6e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/gnrc_tftp/tftp_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static bool _tftp_client_start_cb(tftp_action_t action, tftp_mode_t mode,
str_mode = "bin";
}
else if (mode == TTM_MAIL) {
str_mode = "main";
str_mode = "mail";
}

/* translate the action */
Expand Down
2 changes: 1 addition & 1 deletion examples/gnrc_tftp/tftp_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static bool _tftp_server_start_cb(tftp_action_t action, tftp_mode_t mode,
str_mode = "bin";
}
else if (mode == TTM_MAIL) {
str_mode = "main";
str_mode = "mail";
}

/* translate the action */
Expand Down
5 changes: 1 addition & 4 deletions sys/net/gnrc/application_layer/tftp/gnrc_tftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,9 @@ static uint16_t _tftp_get_maximum_block_size(void)
kernel_pid_t ifs[GNRC_NETIF_NUMOF];
size_t ifnum = gnrc_netif_get(ifs);

/* TODO REMOVE */
return 10;

if (ifnum > 0 && gnrc_netapi_get(ifs[0], NETOPT_MAX_PACKET_SIZE, 0, &tmp, sizeof(uint16_t)) >= 0) {
/* TODO calculate proper block size */
return tmp - sizeof(udp_hdr_t) - sizeof(ipv6_hdr_t) - 50;
return tmp - sizeof(udp_hdr_t) - sizeof(ipv6_hdr_t) - 10;
}

return GNRC_TFTP_MAX_TRANSFER_UNIT;
Expand Down

0 comments on commit ef62d6e

Please sign in to comment.