2 Copyright (C) 2006 OpenWrt.org
4 diff -Nur busybox-1.1.1/include/applets.h busybox-1.1.1-owrt/include/applets.h
5 --- busybox-1.1.1/include/applets.h 2006-04-01 18:26:21.000000000 +0200
6 +++ busybox-1.1.1-owrt/include/applets.h 2006-04-01 18:36:28.000000000 +0200
8 USE_MV(APPLET(mv, mv_main, _BB_DIR_BIN, _BB_SUID_NEVER))
9 USE_NAMEIF(APPLET(nameif, nameif_main, _BB_DIR_SBIN, _BB_SUID_NEVER))
10 USE_NC(APPLET(nc, nc_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
11 +USE_NETMSG(APPLET_NOUSAGE(netmsg, netmsg_main, _BB_DIR_BIN, _BB_SUID_ALWAYS))
12 USE_NETSTAT(APPLET(netstat, netstat_main, _BB_DIR_BIN, _BB_SUID_NEVER))
13 USE_NICE(APPLET(nice, nice_main, _BB_DIR_BIN, _BB_SUID_NEVER))
14 USE_NOHUP(APPLET(nohup, nohup_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
15 diff -Nur busybox-1.1.1/networking/Config.in busybox-1.1.1-owrt/networking/Config.in
16 --- busybox-1.1.1/networking/Config.in 2006-03-22 22:16:19.000000000 +0100
17 +++ busybox-1.1.1-owrt/networking/Config.in 2006-04-01 18:35:32.000000000 +0200
20 A simple Unix utility which reads and writes data across network
27 + simple program for sending udp broadcast messages
29 config CONFIG_NC_GAPING_SECURITY_HOLE
30 bool "gaping security hole"
31 diff -Nur busybox-1.1.1/networking/Makefile.in busybox-1.1.1-owrt/networking/Makefile.in
32 --- busybox-1.1.1/networking/Makefile.in 2006-03-22 22:16:19.000000000 +0100
33 +++ busybox-1.1.1-owrt/networking/Makefile.in 2006-04-01 18:35:32.000000000 +0200
35 NETWORKING-$(CONFIG_IPTUNNEL) += iptunnel.o
36 NETWORKING-$(CONFIG_NAMEIF) += nameif.o
37 NETWORKING-$(CONFIG_NC) += nc.o
38 +NETWORKING-$(CONFIG_NETMSG) += netmsg.o
39 NETWORKING-$(CONFIG_NETSTAT) += netstat.o
40 NETWORKING-$(CONFIG_NSLOOKUP) += nslookup.o
41 NETWORKING-$(CONFIG_PING) += ping.o
42 diff -Nur busybox-1.1.1/networking/netmsg.c busybox-1.1.1-owrt/networking/netmsg.c
43 --- busybox-1.1.1/networking/netmsg.c 1970-01-01 01:00:00.000000000 +0100
44 +++ busybox-1.1.1-owrt/networking/netmsg.c 2006-04-01 18:35:32.000000000 +0200
47 + * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
49 + * This is free software, licensed under the GNU General Public License v2.
51 +#include <sys/types.h>
52 +#include <sys/socket.h>
53 +#include <netinet/in.h>
61 +#ifndef CONFIG_NETMSG
62 +int main(int argc, char **argv)
64 +int netmsg_main(int argc, char **argv)
68 + struct sockaddr_in addr;
70 + unsigned char buf[1001];
73 + fprintf(stderr, "usage: %s <ip> \"<message>\"\n", argv[0]);
77 + if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
78 + perror("Opening socket");
82 + memset(&addr, 0, sizeof(addr));
83 + addr.sin_family = AF_INET;
84 + addr.sin_addr.s_addr = inet_addr(argv[1]);
85 + addr.sin_port = htons(0x1337);
87 + memset(buf, 0, 1001);
91 + strncpy(buf + 2, argv[2], 998);
93 + if (setsockopt (s, SOL_SOCKET, SO_BROADCAST, (caddr_t) &optval, sizeof (optval)) < 0) {
94 + perror("setsockopt()");
98 + if (sendto(s, buf, 1001, 0, (struct sockaddr *) &addr, sizeof(addr)) < 0) {