diff options
author | Felix Fietkau <nbd@openwrt.org> | 2006-01-14 01:21:53 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2006-01-14 01:21:53 +0000 |
commit | 8853d0b1e293ff8a5fc9365ef0d3640472143b5b (patch) | |
tree | 9aad900d26fec221c1efb6fb46de8c9499fae3fd | |
parent | 6bc7dec92457f6d169428c29092513d5697ea083 (diff) | |
download | master-187ad058-8853d0b1e293ff8a5fc9365ef0d3640472143b5b.tar.gz master-187ad058-8853d0b1e293ff8a5fc9365ef0d3640472143b5b.tar.bz2 master-187ad058-8853d0b1e293ff8a5fc9365ef0d3640472143b5b.zip |
add ip address parameter to netmsg utility
git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@2967 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | package/busybox/patches/300-netmsg.patch | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/package/busybox/patches/300-netmsg.patch b/package/busybox/patches/300-netmsg.patch index ac1a0aaaa8..22ca172c5c 100644 --- a/package/busybox/patches/300-netmsg.patch +++ b/package/busybox/patches/300-netmsg.patch @@ -63,8 +63,8 @@ diff -urN busybox.old/networking/netmsg.c busybox.dev/networking/netmsg.c + int optval = 1; + unsigned char buf[1001]; + -+ if (argc != 2) { -+ fprintf(stderr, "usage: %s \"message\"\n", argv[0]); ++ if (argc != 3) { ++ fprintf(stderr, "usage: %s <ip> \"<message>\"\n", argv[0]); + exit(1); + } + @@ -75,14 +75,14 @@ diff -urN busybox.old/networking/netmsg.c busybox.dev/networking/netmsg.c + + memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; -+ addr.sin_addr.s_addr = htonl(0xffffffff); ++ addr.sin_addr.s_addr = inet_addr(argv[1]); + addr.sin_port = htons(0x1337); + + memset(buf, 0, 1001); + buf[0] = 0xde; + buf[1] = 0xad; + -+ strncpy(buf + 2, argv[1], 998); ++ strncpy(buf + 2, argv[2], 998); + + if (setsockopt (s, SOL_SOCKET, SO_BROADCAST, (caddr_t) &optval, sizeof (optval)) < 0) { + perror("setsockopt()"); |