aboutsummaryrefslogtreecommitdiff
path: root/networking/arp.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/arp.c')
-rw-r--r--networking/arp.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/networking/arp.c b/networking/arp.c
index 71bfe3cbf..6519f8156 100644
--- a/networking/arp.c
+++ b/networking/arp.c
@@ -116,7 +116,7 @@ static int arp_del(char **args)
116 /* Resolve the host name. */ 116 /* Resolve the host name. */
117 host = *args; 117 host = *args;
118 if (ap->input(host, &sa) < 0) { 118 if (ap->input(host, &sa) < 0) {
119 bb_herror_msg_and_die("%s", host); 119 bb_simple_herror_msg_and_die(host);
120 } 120 }
121 121
122 /* If a host has more than one address, use the correct one! */ 122 /* If a host has more than one address, use the correct one! */
@@ -149,7 +149,7 @@ static int arp_del(char **args)
149#ifdef HAVE_ATF_DONTPUB 149#ifdef HAVE_ATF_DONTPUB
150 req.arp_flags |= ATF_DONTPUB; 150 req.arp_flags |= ATF_DONTPUB;
151#else 151#else
152 bb_error_msg("feature ATF_DONTPUB is not supported"); 152 bb_simple_error_msg("feature ATF_DONTPUB is not supported");
153#endif 153#endif
154 args++; 154 args++;
155 break; 155 break;
@@ -157,7 +157,7 @@ static int arp_del(char **args)
157#ifdef HAVE_ATF_MAGIC 157#ifdef HAVE_ATF_MAGIC
158 req.arp_flags |= ATF_MAGIC; 158 req.arp_flags |= ATF_MAGIC;
159#else 159#else
160 bb_error_msg("feature ATF_MAGIC is not supported"); 160 bb_simple_error_msg("feature ATF_MAGIC is not supported");
161#endif 161#endif
162 args++; 162 args++;
163 break; 163 break;
@@ -173,7 +173,7 @@ static int arp_del(char **args)
173 if (strcmp(*args, "255.255.255.255") != 0) { 173 if (strcmp(*args, "255.255.255.255") != 0) {
174 host = *args; 174 host = *args;
175 if (ap->input(host, &sa) < 0) { 175 if (ap->input(host, &sa) < 0) {
176 bb_herror_msg_and_die("%s", host); 176 bb_simple_herror_msg_and_die(host);
177 } 177 }
178 memcpy(&req.arp_netmask, &sa, sizeof(struct sockaddr)); 178 memcpy(&req.arp_netmask, &sa, sizeof(struct sockaddr));
179 req.arp_flags |= ATF_NETMASK; 179 req.arp_flags |= ATF_NETMASK;
@@ -195,7 +195,7 @@ static int arp_del(char **args)
195 /* Call the kernel. */ 195 /* Call the kernel. */
196 if (flags & 2) { 196 if (flags & 2) {
197 if (option_mask32 & ARP_OPT_v) 197 if (option_mask32 & ARP_OPT_v)
198 bb_error_msg("SIOCDARP(nopub)"); 198 bb_simple_error_msg("SIOCDARP(nopub)");
199 err = ioctl(sockfd, SIOCDARP, &req); 199 err = ioctl(sockfd, SIOCDARP, &req);
200 if (err < 0) { 200 if (err < 0) {
201 if (errno == ENXIO) { 201 if (errno == ENXIO) {
@@ -204,20 +204,20 @@ static int arp_del(char **args)
204 printf("No ARP entry for %s\n", host); 204 printf("No ARP entry for %s\n", host);
205 return -1; 205 return -1;
206 } 206 }
207 bb_perror_msg_and_die("SIOCDARP(priv)"); 207 bb_simple_perror_msg_and_die("SIOCDARP(priv)");
208 } 208 }
209 } 209 }
210 if ((flags & 1) && err) { 210 if ((flags & 1) && err) {
211 nopub: 211 nopub:
212 req.arp_flags |= ATF_PUBL; 212 req.arp_flags |= ATF_PUBL;
213 if (option_mask32 & ARP_OPT_v) 213 if (option_mask32 & ARP_OPT_v)
214 bb_error_msg("SIOCDARP(pub)"); 214 bb_simple_error_msg("SIOCDARP(pub)");
215 if (ioctl(sockfd, SIOCDARP, &req) < 0) { 215 if (ioctl(sockfd, SIOCDARP, &req) < 0) {
216 if (errno == ENXIO) { 216 if (errno == ENXIO) {
217 printf("No ARP entry for %s\n", host); 217 printf("No ARP entry for %s\n", host);
218 return -1; 218 return -1;
219 } 219 }
220 bb_perror_msg_and_die("SIOCDARP(pub)"); 220 bb_simple_perror_msg_and_die("SIOCDARP(pub)");
221 } 221 }
222 } 222 }
223 return 0; 223 return 0;
@@ -233,7 +233,7 @@ static void arp_getdevhw(char *ifname, struct sockaddr *sa)
233 ioctl_or_perror_and_die(sockfd, SIOCGIFHWADDR, &ifr, 233 ioctl_or_perror_and_die(sockfd, SIOCGIFHWADDR, &ifr,
234 "can't get HW-Address for '%s'", ifname); 234 "can't get HW-Address for '%s'", ifname);
235 if (hw_set && (ifr.ifr_hwaddr.sa_family != hw->type)) { 235 if (hw_set && (ifr.ifr_hwaddr.sa_family != hw->type)) {
236 bb_error_msg_and_die("protocol type mismatch"); 236 bb_simple_error_msg_and_die("protocol type mismatch");
237 } 237 }
238 memcpy(sa, &(ifr.ifr_hwaddr), sizeof(struct sockaddr)); 238 memcpy(sa, &(ifr.ifr_hwaddr), sizeof(struct sockaddr));
239 239
@@ -261,20 +261,20 @@ static int arp_set(char **args)
261 261
262 host = *args++; 262 host = *args++;
263 if (ap->input(host, &sa) < 0) { 263 if (ap->input(host, &sa) < 0) {
264 bb_herror_msg_and_die("%s", host); 264 bb_simple_herror_msg_and_die(host);
265 } 265 }
266 /* If a host has more than one address, use the correct one! */ 266 /* If a host has more than one address, use the correct one! */
267 memcpy(&req.arp_pa, &sa, sizeof(struct sockaddr)); 267 memcpy(&req.arp_pa, &sa, sizeof(struct sockaddr));
268 268
269 /* Fetch the hardware address. */ 269 /* Fetch the hardware address. */
270 if (*args == NULL) { 270 if (*args == NULL) {
271 bb_error_msg_and_die("need hardware address"); 271 bb_simple_error_msg_and_die("need hardware address");
272 } 272 }
273 if (option_mask32 & ARP_OPT_D) { 273 if (option_mask32 & ARP_OPT_D) {
274 arp_getdevhw(*args++, &req.arp_ha); 274 arp_getdevhw(*args++, &req.arp_ha);
275 } else { 275 } else {
276 if (hw->input(*args++, &req.arp_ha) < 0) { 276 if (hw->input(*args++, &req.arp_ha) < 0) {
277 bb_error_msg_and_die("invalid hardware address"); 277 bb_simple_error_msg_and_die("invalid hardware address");
278 } 278 }
279 } 279 }
280 280
@@ -302,7 +302,7 @@ static int arp_set(char **args)
302#ifdef HAVE_ATF_DONTPUB 302#ifdef HAVE_ATF_DONTPUB
303 flags |= ATF_DONTPUB; 303 flags |= ATF_DONTPUB;
304#else 304#else
305 bb_error_msg("feature ATF_DONTPUB is not supported"); 305 bb_simple_error_msg("feature ATF_DONTPUB is not supported");
306#endif 306#endif
307 args++; 307 args++;
308 break; 308 break;
@@ -310,7 +310,7 @@ static int arp_set(char **args)
310#ifdef HAVE_ATF_MAGIC 310#ifdef HAVE_ATF_MAGIC
311 flags |= ATF_MAGIC; 311 flags |= ATF_MAGIC;
312#else 312#else
313 bb_error_msg("feature ATF_MAGIC is not supported"); 313 bb_simple_error_msg("feature ATF_MAGIC is not supported");
314#endif 314#endif
315 args++; 315 args++;
316 break; 316 break;
@@ -326,7 +326,7 @@ static int arp_set(char **args)
326 if (strcmp(*args, "255.255.255.255") != 0) { 326 if (strcmp(*args, "255.255.255.255") != 0) {
327 host = *args; 327 host = *args;
328 if (ap->input(host, &sa) < 0) { 328 if (ap->input(host, &sa) < 0) {
329 bb_herror_msg_and_die("%s", host); 329 bb_simple_herror_msg_and_die(host);
330 } 330 }
331 memcpy(&req.arp_netmask, &sa, sizeof(struct sockaddr)); 331 memcpy(&req.arp_netmask, &sa, sizeof(struct sockaddr));
332 flags |= ATF_NETMASK; 332 flags |= ATF_NETMASK;
@@ -346,7 +346,7 @@ static int arp_set(char **args)
346 346
347 /* Call the kernel. */ 347 /* Call the kernel. */
348 if (option_mask32 & ARP_OPT_v) 348 if (option_mask32 & ARP_OPT_v)
349 bb_error_msg("SIOCSARP()"); 349 bb_simple_error_msg("SIOCSARP()");
350 xioctl(sockfd, SIOCSARP, &req); 350 xioctl(sockfd, SIOCSARP, &req);
351 return 0; 351 return 0;
352} 352}
@@ -422,7 +422,7 @@ static int arp_show(char *name)
422 if (name != NULL) { 422 if (name != NULL) {
423 /* Resolve the host name. */ 423 /* Resolve the host name. */
424 if (ap->input(name, &sa) < 0) { 424 if (ap->input(name, &sa) < 0) {
425 bb_herror_msg_and_die("%s", name); 425 bb_simple_herror_msg_and_die(name);
426 } 426 }
427 host = xstrdup(ap->sprint(&sa, 1)); 427 host = xstrdup(ap->sprint(&sa, 1));
428 } 428 }
@@ -530,7 +530,7 @@ int arp_main(int argc UNUSED_PARAM, char **argv)
530 /* Now see what we have to do here... */ 530 /* Now see what we have to do here... */
531 if (opts & (ARP_OPT_d | ARP_OPT_s)) { 531 if (opts & (ARP_OPT_d | ARP_OPT_s)) {
532 if (argv[0] == NULL) 532 if (argv[0] == NULL)
533 bb_error_msg_and_die("need host name"); 533 bb_simple_error_msg_and_die("need host name");
534 if (opts & ARP_OPT_s) 534 if (opts & ARP_OPT_s)
535 return arp_set(argv); 535 return arp_set(argv);
536 return arp_del(argv); 536 return arp_del(argv);