Changeset 3295
- Timestamp:
- 07/20/07 13:49:20 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/freewrt/package/busybox/patches/300-netmsg.patch
r1904 r3295 1 diff -Nur busybox-1.4.1.orig/include/applets.h busybox-1.4.1/include/applets.h 2 --- busybox-1.4. 1.orig/include/applets.h 2007-01-24 22:34:48.000000000 +01003 +++ busybox-1.4. 1/include/applets.h 2007-02-05 13:11:49.000000000 +01004 @@ -209,6 +209,7 @@ 1 $FreeWRT$ 2 --- busybox-1.4.2.orig/include/applets.h Sun Mar 18 16:59:11 2007 3 +++ busybox-1.4.2/include/applets.h Fri Jul 20 11:39:04 2007 4 @@ -209,6 +209,7 @@ USE_MT(APPLET(mt, _BB_DIR_BIN, _BB_SUID_ 5 5 USE_MV(APPLET(mv, _BB_DIR_BIN, _BB_SUID_NEVER)) 6 6 USE_NAMEIF(APPLET(nameif, _BB_DIR_SBIN, _BB_SUID_NEVER)) … … 10 10 USE_NICE(APPLET(nice, _BB_DIR_BIN, _BB_SUID_NEVER)) 11 11 USE_NMETER(APPLET(nmeter, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) 12 diff -Nur busybox-1.4.1.orig/networking/Config.in busybox-1.4.1/networking/Config.in 13 --- busybox-1.4.1.orig/networking/Config.in 2007-01-24 22:34:34.000000000 +0100 14 +++ busybox-1.4.1/networking/Config.in 2007-02-05 13:12:25.000000000 +0100 15 @@ -458,7 +458,7 @@ 16 help 17 A simple Unix utility which reads and writes data across network 18 connections. 19 - 20 + 21 config NC_SERVER 22 bool "Netcat server options (-lp)" 23 default n 24 @@ -475,6 +475,12 @@ 25 making or receiving a successful connection), -i (delay interval for 26 lines sent), -w (timeout for initial connection). 27 28 +config NETMSG 29 + bool "netmsg" 30 + default n 31 + help 32 + simple program for sending udp broadcast messages 33 + 34 config NETSTAT 35 bool "netstat" 36 default n 37 diff -Nur busybox-1.4.1.orig/networking/Kbuild busybox-1.4.1/networking/Kbuild 38 --- busybox-1.4.1.orig/networking/Kbuild 2007-01-24 22:34:34.000000000 +0100 39 +++ busybox-1.4.1/networking/Kbuild 2007-02-05 13:11:49.000000000 +0100 40 @@ -27,6 +27,7 @@ 12 --- busybox-1.4.2.orig/networking/Kbuild Sun Mar 18 16:59:01 2007 13 +++ busybox-1.4.2/networking/Kbuild Fri Jul 20 11:39:04 2007 14 @@ -27,6 +27,7 @@ lib-$(CONFIG_IPRULE) += iprule.o 41 15 lib-$(CONFIG_IPTUNNEL) += iptunnel.o 42 16 lib-$(CONFIG_NAMEIF) += nameif.o … … 46 20 lib-$(CONFIG_NSLOOKUP) += nslookup.o 47 21 lib-$(CONFIG_PING) += ping.o 48 diff -Nur busybox-1.4.1.orig/networking/netmsg.c busybox-1.4.1/networking/netmsg.c 49 --- busybox-1.4.1.orig/networking/netmsg.c 1970-01-01 01:00:00.000000000 +0100 50 +++ busybox-1.4.1/networking/netmsg.c 2007-02-05 13:11:49.000000000 +0100 51 @@ -0,0 +1,63 @@ 22 --- busybox-1.4.2.orig/networking/Config.in Sun Mar 18 16:59:01 2007 23 +++ busybox-1.4.2/networking/Config.in Fri Jul 20 11:39:04 2007 24 @@ -474,6 +474,12 @@ config NC_EXTRA 25 Add -e (support for executing the rest of the command line after 26 making or receiving a successful connection), -i (delay interval for 27 lines sent), -w (timeout for initial connection). 28 + 29 +config NETMSG 30 + bool "netmsg" 31 + default n 32 + help 33 + simple program for sending udp broadcast messages 34 35 config NETSTAT 36 bool "netstat" 37 --- busybox-1.4.2.orig/networking/netmsg.c Thu Jan 1 00:00:00 1970 38 +++ busybox-1.4.2/networking/netmsg.c Fri Jul 20 11:45:58 2007 39 @@ -0,0 +1,67 @@ 52 40 +/* 53 41 + * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org> 42 + * Copyright (c) 2007 Thorsten Glaser <tg@mirbsd.org> 54 43 + * 55 + * This is free software, licen sed under the GNU General Public License v2.44 + * This is free software, licenced under the GNU General Public License v2. 56 45 + */ 46 + 57 47 +#include <sys/types.h> 58 48 +#include <sys/socket.h> … … 64 54 +#include "busybox.h" 65 55 + 66 +67 56 +#ifndef CONFIG_NETMSG 68 57 +int main(int argc, char **argv) … … 71 60 +#endif 72 61 +{ 73 + int s ;62 + int s, optval = -1, rv = 1; 74 63 + struct sockaddr_in addr; 75 + int optval = 1;76 64 + unsigned char buf[1001]; 77 65 + 78 66 + if (argc != 3) { 79 67 + fprintf(stderr, "usage: %s <ip> \"<message>\"\n", argv[0]); 80 + exit(1);68 + return (1); 81 69 + } 82 70 + 83 71 + if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { 84 72 + perror("Opening socket"); 85 + exit(1);73 + return (1); 86 74 + } 87 75 + 88 + memset(&addr, 0, sizeof (addr));76 + memset(&addr, 0, sizeof (addr)); 89 77 + addr.sin_family = AF_INET; 90 78 + addr.sin_addr.s_addr = inet_addr(argv[1]); 91 79 + addr.sin_port = htons(0x1337); 92 80 + 93 + memset(buf, 0, 1001); 94 + buf[0] = 0xde; 95 + buf[1] = 0xad; 81 + while (strlen(argv[2]) > 0) { 82 + memset(buf, 0, sizeof (buf)); 96 83 + 97 + strncpy(buf + 2, argv[2], 998); 84 + buf[0] = 0xde; 85 + buf[1] = 0xad; 86 + strlcpy(buf + 2, argv[2], sizeof (buf) - 2); 87 + argv[2] += strlen(buf + 2); 98 88 + 99 + if (setsockopt (s, SOL_SOCKET, SO_BROADCAST, (caddr_t) &optval, sizeof (optval)) < 0) { 100 + perror("setsockopt()"); 101 + goto fail; 89 + if (setsockopt(s, SOL_SOCKET, SO_BROADCAST, 90 + (caddr_t)&optval, sizeof (optval)) < 0) { 91 + perror("setsockopt()"); 92 + goto fail; 93 + } 94 + 95 + if (sendto(s, buf, 1001, 0, (struct sockaddr *)&addr, 96 + sizeof (addr)) < 0) { 97 + perror("sendto()"); 98 + goto fail; 99 + } 102 100 + } 101 + rv = 0; 103 102 + 104 + if (sendto(s, buf, 1001, 0, (struct sockaddr *) &addr, sizeof(addr)) < 0) { 105 + perror("sendto()"); 106 + goto fail; 107 + } 108 + 109 + return 0; 110 + 111 +fail: 103 + fail: 112 104 + close(s); 113 + exit(1);105 + return (rv); 114 106 +} trunk/freewrt/package/busybox/patches/980-crontab-use-editor.patch
r2748 r3295 1 --- busybox-1.4.2/miscutils/crontab.c.orig Thu May 24 11:11:37 2007 2 +++ busybox-1.4.2/miscutils/crontab.c Fri May 25 13:44:07 2007 1 $FreeWRT$ 2 --- busybox-1.4.2.orig/miscutils/crontab.c Sun Mar 18 16:59:11 2007 3 +++ busybox-1.4.2/miscutils/crontab.c Fri Jul 20 11:39:04 2007 3 4 @@ -297,6 +297,8 @@ static void EditFile(const char *user, c 4 5 exit(0); … … 10 11 11 12 snprintf(visual, sizeof(visual), "%s %s", ptr, file); 12 --- busybox-1.4.2/networking/netmsg.c.orig Wed Jun 6 15:28:44 200713 +++ busybox-1.4.2/networking/netmsg.c Fri Jun 8 13:12:08 200714 @@ -34,6 +34,8 @@ int netmsg_main(int argc, char **argv)15 exit(1);16 }17 18 + while (strlen(argv[2]) > 0) {19 +20 memset(&addr, 0, sizeof(addr));21 addr.sin_family = AF_INET;22 addr.sin_addr.s_addr = inet_addr(argv[1]);23 @@ -44,6 +46,7 @@ int netmsg_main(int argc, char **argv)24 buf[1] = 0xad;25 26 strncpy(buf + 2, argv[2], 998);27 + argv[2] += strlen(buf + 2);28 29 if (setsockopt (s, SOL_SOCKET, SO_BROADCAST, (caddr_t) &optval, sizeof (optval)) < 0) {30 perror("setsockopt()");31 @@ -53,6 +56,8 @@ int netmsg_main(int argc, char **argv)32 if (sendto(s, buf, 1001, 0, (struct sockaddr *) &addr, sizeof(addr)) < 0) {33 perror("sendto()");34 goto fail;35 + }36 +37 }38 39 return 0;


