(0002612)
vda
07-21-07 07:06
|
1. You can use netcat for that, we have that in bbox.
2. It's easier to discuss patches on the mailing list.
3. Review:
+ while (strlen(argv[2]) > 0) {
argv[2][0] != 0
+ memset(buf, 0, sizeof (buf));
+
+ buf[0] = 0xde;
+ buf[1] = 0xad;
+ strlcpy(buf + 2, argv[2], sizeof (buf) - 2);
Use strncpy, it will do memset for you.
+ argv[2] += strlen(buf + 2);
In effect you scan argv[2] byte-by-byte twice here.
+
+ if (setsockopt(s, SOL_SOCKET, SO_BROADCAST,
+ (caddr_t)&optval, sizeof (optval)) < 0) {
+ perror("setsockopt()");
bb_perror_msg_and_die() |