From 37a658c4c86fa5ad9fb6f76cba2fca80f4249036 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 23 Mar 2010 15:43:08 +0100 Subject: udhcp: handle errors in read_staticlease also gets rid of ether-aton's static buffer in ether-wake: text data bss dec hexfilename 838664 441 7572 846677 ceb55busybox_old 838650 441 7564 846655 ceb3fbusybox_unstripped Signed-off-by: Denys Vlasenko --- networking/ether-wake.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'networking/ether-wake.c') diff --git a/networking/ether-wake.c b/networking/ether-wake.c index e05db7a80..deeb68c09 100644 --- a/networking/ether-wake.c +++ b/networking/ether-wake.c @@ -111,10 +111,9 @@ static void get_dest_addr(const char *hostid, struct ether_addr *eaddr) { struct ether_addr *eap; - eap = ether_aton(hostid); + eap = ether_aton_r(hostid, eaddr); if (eap) { - *eaddr = *eap; - 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(eap)); #if !defined(__UCLIBC_MAJOR__) \ || __UCLIBC_MAJOR__ > 0 \ || __UCLIBC_MINOR__ > 9 \ @@ -122,8 +121,9 @@ static void get_dest_addr(const char *hostid, struct ether_addr *eaddr) } else if (ether_hostton(hostid, eaddr) == 0) { bb_debug_msg("Station address for hostname %s is %s\n\n", hostid, ether_ntoa(eaddr)); #endif - } else + } else { bb_show_usage(); + } } static int get_fill(unsigned char *pkt, struct ether_addr *eaddr, int broadcast) -- cgit v1.2.3