TFTP Broadcast Patch

Denys Vlasenko vda.linux at googlemail.com
Tue Aug 5 23:43:25 UTC 2008


On Tuesday 05 August 2008 18:27, Mandeep Ahuja wrote:
> Hi all,
> I am using busybox 1.2.2.1.

It's a bit old.

> When I do a GET to a broadcast address it says
> 
> tftp: send: Permission denied.
> 
> Can someone help with supporting *tftp broadcast*.

Yes. Patch is against current svn:
--
vda


diff -d -urpN busybox.2/networking/tftp.c busybox.3/networking/tftp.c
--- busybox.2/networking/tftp.c	2008-08-06 00:55:59.000000000 +0200
+++ busybox.3/networking/tftp.c	2008-08-06 01:40:47.000000000 +0200
@@ -196,6 +196,7 @@ static int tftp_protocol(
 
 	socket_fd = xsocket(peer_lsa->u.sa.sa_family, SOCK_DGRAM, 0);
 	setsockopt_reuseaddr(socket_fd);
+	setsockopt_broadcast(socket_fd);
 
 	block_nr = 1;
 	cp = xbuf + 2;





More information about the busybox mailing list