[PATCH v3 11/18] tftp: reduce block size on lookup requests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Save some bytes on network traffic by reducing the server response for
lookup requests.

Signed-off-by: Enrico Scholz <enrico.scholz@xxxxxxxxxxxxxxxxx>
---
 fs/tftp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/tftp.c b/fs/tftp.c
index 9f881249ce07..2ed62b77901b 100644
--- a/fs/tftp.c
+++ b/fs/tftp.c
@@ -148,7 +148,9 @@ static int tftp_send(struct file_priv *priv)
 				'\0',	/* "tsize" */
 				priv->filesize, '\0',
 				'\0',	/* "blksize" */
-				TFTP_MTU_SIZE);
+				/* use only a minimal blksize for getattr
+				   operations, */
+				priv->is_getattr ? TFTP_BLOCK_SIZE : TFTP_MTU_SIZE);
 		pkt++;
 		len = pkt - xp;
 		break;
-- 
2.37.1





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux