+ } else { /* got an arg so process it */
+ HOSTNAME:
+ did_flags |= (mask & A_NETMASK);
+ if (mask & A_CAST_HOST_COPY) {
+#ifdef BB_FEATURE_IFCONFIG_HW
+ if (mask & A_CAST_RESOLVE) {
+#endif
+ safe_strncpy(host, *argv, (sizeof host));
+ sai.sin_family = AF_INET;
+ sai.sin_port = 0;
+ if (!strcmp(host, "default")) {
+ /* Default is special, meaning 0.0.0.0. */
+ sai.sin_addr.s_addr = INADDR_ANY;
+ } else if (inet_aton(host, &sai.sin_addr) == 0) {
+ /* It's not a dotted quad. */
+ ++goterr;
+ continue;
+ }
+ p = (char *) &sai;
+#ifdef BB_FEATURE_IFCONFIG_HW
+ } else { /* A_CAST_HOST_COPY_IN_ETHER */
+ /* This is the "hw" arg case. */
+ if (strcmp("ether", *argv) || (*++argv == NULL)) {
+ show_usage();
+ }
+ safe_strncpy(host, *argv, (sizeof host));
+ if (in_ether(host, &sa)) {
+ fprintf(stderr, "invalid hw-addr %s\n", host);
+ ++goterr;
+ continue;
+ }
+ p = (char *) &sa;
+ }
+#endif
+ memcpy((((char *)(&ifr)) + a1op->ifr_offset),
+ p, sizeof(struct sockaddr));
+ } else {
+ unsigned int i = strtoul(*argv,NULL,0);
+ p = ((char *)(&ifr)) + a1op->ifr_offset;
+#ifdef BB_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ
+ if (mask & A_MAP_TYPE) {
+ if (ioctl(sockfd, SIOCGIFMAP, &ifr) < 0) {
+ ++goterr;
+ continue;
+ }
+ if ((mask & A_MAP_UCHAR) == A_MAP_UCHAR) {
+ *((unsigned char *) p) = i;
+ } else if (mask & A_MAP_USHORT) {
+ *((unsigned short *) p) = i;
+ } else {
+ *((unsigned long *) p) = i;
+ }
+ } else
+#endif
+ if (mask & A_CAST_CHAR_PTR) {
+ *((caddr_t *) p) = (caddr_t) i;
+ } else { /* A_CAST_INT */
+ *((int *) p) = i;
+ }