projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gzip cleanup part #8
[oweals/busybox.git]
/
networking
/
ether-wake.c
diff --git
a/networking/ether-wake.c
b/networking/ether-wake.c
index cc2fb62a3c1471f6aaaa9e335e7b42ae08a7ddc8..e205ffc00073adca716ba4dad25eb78b8d22a7a1 100644
(file)
--- a/
networking/ether-wake.c
+++ b/
networking/ether-wake.c
@@
-145,7
+145,7
@@
int ether_wake_main(int argc, char *argv[])
{
struct ifreq if_hwaddr;
{
struct ifreq if_hwaddr;
- str
cpy(if_hwaddr.ifr_name, ifname
);
+ str
ncpy(if_hwaddr.ifr_name, ifname, sizeof(if_hwaddr.ifr_name)
);
if (ioctl(s, SIOCGIFHWADDR, &if_hwaddr) < 0)
bb_perror_msg_and_die("SIOCGIFHWADDR on %s failed", ifname);
if (ioctl(s, SIOCGIFHWADDR, &if_hwaddr) < 0)
bb_perror_msg_and_die("SIOCGIFHWADDR on %s failed", ifname);
@@
-175,8
+175,7
@@
int ether_wake_main(int argc, char *argv[])
/* This is necessary for broadcasts to work */
if (flags /*& 1 [OPT_BROADCAST]*/) {
/* This is necessary for broadcasts to work */
if (flags /*& 1 [OPT_BROADCAST]*/) {
- int one = 1;
- if (setsockopt(s, SOL_SOCKET, SO_BROADCAST, (void *)&one, sizeof(one)) < 0)
+ if (setsockopt_broadcast(s) < 0)
bb_perror_msg("SO_BROADCAST");
}
bb_perror_msg("SO_BROADCAST");
}