Ignore:
Timestamp:
Feb 25, 2011, 9:26:54 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi-busybox/networking/ether-wake.c

    r1765 r2725  
    33 * ether-wake.c - Send a magic packet to wake up sleeping machines.
    44 *
    5  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
     5 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
    66 *
    77 * Author:      Donald Becker, http://www.scyld.com/"; http://www.scyld.com/wakeonlan.html
     
    9393    for (i = 0; i < pktsize; ++i) {
    9494        printf("%2.2x ", outpack[i]);
    95         if (i % 20 == 19) puts("");
     95        if (i % 20 == 19) bb_putchar('\n');
    9696    }
    9797    printf("\n\n");
     
    112112    struct ether_addr *eap;
    113113
    114     eap = ether_aton(hostid);
     114    eap = ether_aton_r(hostid, eaddr);
    115115    if (eap) {
    116         *eaddr = *eap;
    117         bb_debug_msg("The target station address is %s\n\n", ether_ntoa(eaddr));
    118 #if !defined(__UCLIBC__)
     116        bb_debug_msg("The target station address is %s\n\n", ether_ntoa(eap));
     117#if !defined(__UCLIBC_MAJOR__) \
     118 || __UCLIBC_MAJOR__ > 0 \
     119 || __UCLIBC_MINOR__ > 9 \
     120 || (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ >= 30)
    119121    } else if (ether_hostton(hostid, eaddr) == 0) {
    120122        bb_debug_msg("Station address for hostname %s is %s\n\n", hostid, ether_ntoa(eaddr));
    121123#endif
    122     } else
     124    } else {
    123125        bb_show_usage();
     126    }
    124127}
    125128
     
    165168                          &passwd[0], &passwd[1], &passwd[2], &passwd[3]);
    166169    if (byte_cnt < 4) {
    167         bb_error_msg("cannot read Wake-On-LAN pass");
     170        bb_error_msg("can't read Wake-On-LAN pass");
    168171        return 0;
    169172    }
     
    179182}
    180183
    181 int ether_wake_main(int argc, char **argv);
    182 int ether_wake_main(int argc, char **argv)
     184int ether_wake_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
     185int ether_wake_main(int argc UNUSED_PARAM, char **argv)
    183186{
    184187    const char *ifname = "eth0";
     
    187190    unsigned char wol_passwd[6];
    188191    int wol_passwd_sz = 0;
    189     int s;                      /* Raw socket */
     192    int s;  /* Raw socket */
    190193    int pktsize;
    191194    unsigned char outpack[1000];
    192195
    193196    struct ether_addr eaddr;
    194     struct whereto_t whereto;   /* who to wake up */
     197    struct whereto_t whereto;  /* who to wake up */
    195198
    196199    /* handle misc user options */
     
    220223        struct ifreq if_hwaddr;
    221224
    222         strncpy(if_hwaddr.ifr_name, ifname, sizeof(if_hwaddr.ifr_name));
     225        strncpy_IFNAMSIZ(if_hwaddr.ifr_name, ifname);
    223226        ioctl_or_perror_and_die(s, SIOCGIFHWADDR, &if_hwaddr, "SIOCGIFHWADDR on %s failed", ifname);
    224227
     
    256259    {
    257260        struct ifreq ifr;
    258         strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
     261        strncpy_IFNAMSIZ(ifr.ifr_name, ifname);
    259262        xioctl(s, SIOCGIFINDEX, &ifr);
    260263        memset(&whereto, 0, sizeof(whereto));
Note: See TracChangeset for help on using the changeset viewer.