diff options
| -rw-r--r-- | networking/ipcalc.c | 7 | ||||
| -rw-r--r-- | networking/udhcp/files.c | 4 |
2 files changed, 3 insertions, 8 deletions
diff --git a/networking/ipcalc.c b/networking/ipcalc.c index 9e92b643e..8578893af 100644 --- a/networking/ipcalc.c +++ b/networking/ipcalc.c | |||
| @@ -175,16 +175,13 @@ int ipcalc_main(int argc, char **argv) | |||
| 175 | 175 | ||
| 176 | if (opt & HOSTNAME) { | 176 | if (opt & HOSTNAME) { |
| 177 | struct hostent *hostinfo; | 177 | struct hostent *hostinfo; |
| 178 | int x; | ||
| 179 | 178 | ||
| 180 | hostinfo = gethostbyaddr((char *) &ipaddr, sizeof(ipaddr), AF_INET); | 179 | hostinfo = gethostbyaddr((char *) &ipaddr, sizeof(ipaddr), AF_INET); |
| 181 | if (!hostinfo) { | 180 | if (!hostinfo) { |
| 182 | bb_herror_msg_and_die("cannot find hostname for %s", argv[0]); | 181 | bb_herror_msg_and_die("cannot find hostname for %s", argv[0]); |
| 183 | } | 182 | } |
| 184 | for (x = 0; hostinfo->h_name[x]; x++) { | 183 | str_tolower(hostinfo->h_name); |
| 185 | hostinfo->h_name[x] = tolower(hostinfo->h_name[x]); | 184 | |
| 186 | } | ||
| 187 | |||
| 188 | printf("HOSTNAME=%s\n", hostinfo->h_name); | 185 | printf("HOSTNAME=%s\n", hostinfo->h_name); |
| 189 | } | 186 | } |
| 190 | } | 187 | } |
diff --git a/networking/udhcp/files.c b/networking/udhcp/files.c index 043a95bb0..e0e8b12c3 100644 --- a/networking/udhcp/files.c +++ b/networking/udhcp/files.c | |||
| @@ -26,13 +26,11 @@ static int read_ip(const char *line, void *arg) | |||
| 26 | 26 | ||
| 27 | static int read_mac(const char *line, void *arg) | 27 | static int read_mac(const char *line, void *arg) |
| 28 | { | 28 | { |
| 29 | uint8_t *mac_bytes = arg; | ||
| 30 | struct ether_addr *temp_ether_addr; | 29 | struct ether_addr *temp_ether_addr; |
| 31 | 30 | ||
| 32 | temp_ether_addr = ether_aton(line); | 31 | temp_ether_addr = ether_aton_r(line, (struct ether_addr *)arg); |
| 33 | if (temp_ether_addr == NULL) | 32 | if (temp_ether_addr == NULL) |
| 34 | return 0; | 33 | return 0; |
| 35 | memcpy(mac_bytes, temp_ether_addr, 6); | ||
| 36 | return 1; | 34 | return 1; |
| 37 | } | 35 | } |
| 38 | 36 | ||
