Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/networking/ether-wake.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 983 by niro, Fri Apr 24 18:33:46 2009 UTC revision 984 by niro, Sun May 30 11:32:42 2010 UTC
# Line 115  static void get_dest_addr(const char *ho Line 115  static void get_dest_addr(const char *ho
115   if (eap) {   if (eap) {
116   *eaddr = *eap;   *eaddr = *eap;
117   bb_debug_msg("The target station address is %s\n\n", ether_ntoa(eaddr));   bb_debug_msg("The target station address is %s\n\n", ether_ntoa(eaddr));
118  #if !defined(__UCLIBC__)  #if !defined(__UCLIBC_MAJOR__) \
119     || __UCLIBC_MAJOR__ > 0 \
120     || __UCLIBC_MINOR__ > 9 \
121     || (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ >= 30)
122   } else if (ether_hostton(hostid, eaddr) == 0) {   } else if (ether_hostton(hostid, eaddr) == 0) {
123   bb_debug_msg("Station address for hostname %s is %s\n\n", hostid, ether_ntoa(eaddr));   bb_debug_msg("Station address for hostname %s is %s\n\n", hostid, ether_ntoa(eaddr));
124  #endif  #endif
# Line 164  static int get_wol_pw(const char *ethopt Line 167  static int get_wol_pw(const char *ethopt
167   byte_cnt = sscanf(ethoptarg, "%u.%u.%u.%u",   byte_cnt = sscanf(ethoptarg, "%u.%u.%u.%u",
168                    &passwd[0], &passwd[1], &passwd[2], &passwd[3]);                    &passwd[0], &passwd[1], &passwd[2], &passwd[3]);
169   if (byte_cnt < 4) {   if (byte_cnt < 4) {
170   bb_error_msg("cannot read Wake-On-LAN pass");   bb_error_msg("can't read Wake-On-LAN pass");
171   return 0;   return 0;
172   }   }
173  // TODO: check invalid numbers >255??  // TODO: check invalid numbers >255??
# Line 219  int ether_wake_main(int argc UNUSED_PARA Line 222  int ether_wake_main(int argc UNUSED_PARA
222   {   {
223   struct ifreq if_hwaddr;   struct ifreq if_hwaddr;
224    
225   strncpy(if_hwaddr.ifr_name, ifname, sizeof(if_hwaddr.ifr_name));   strncpy_IFNAMSIZ(if_hwaddr.ifr_name, ifname);
226   ioctl_or_perror_and_die(s, SIOCGIFHWADDR, &if_hwaddr, "SIOCGIFHWADDR on %s failed", ifname);   ioctl_or_perror_and_die(s, SIOCGIFHWADDR, &if_hwaddr, "SIOCGIFHWADDR on %s failed", ifname);
227    
228   memcpy(outpack+6, if_hwaddr.ifr_hwaddr.sa_data, 6);   memcpy(outpack+6, if_hwaddr.ifr_hwaddr.sa_data, 6);
# Line 255  int ether_wake_main(int argc UNUSED_PARA Line 258  int ether_wake_main(int argc UNUSED_PARA
258  #if defined(PF_PACKET)  #if defined(PF_PACKET)
259   {   {
260   struct ifreq ifr;   struct ifreq ifr;
261   strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));   strncpy_IFNAMSIZ(ifr.ifr_name, ifname);
262   xioctl(s, SIOCGIFINDEX, &ifr);   xioctl(s, SIOCGIFINDEX, &ifr);
263   memset(&whereto, 0, sizeof(whereto));   memset(&whereto, 0, sizeof(whereto));
264   whereto.sll_family = AF_PACKET;   whereto.sll_family = AF_PACKET;

Legend:
Removed from v.983  
changed lines
  Added in v.984