Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/networking/nameif.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 983 by niro, Fri Apr 24 18:33:46 2009 UTC revision 984 by niro, Sun May 30 11:32:42 2010 UTC
# Line 92  static void nameif_parse_selector(ethtab Line 92  static void nameif_parse_selector(ethtab
92   lmac = xmalloc(ETH_ALEN);   lmac = xmalloc(ETH_ALEN);
93   ch->mac = ether_aton_r(selector + (strncmp(selector, "mac=", 4) ? 0 : 4), lmac);   ch->mac = ether_aton_r(selector + (strncmp(selector, "mac=", 4) ? 0 : 4), lmac);
94   if (ch->mac == NULL)   if (ch->mac == NULL)
95   bb_error_msg_and_die("cannot parse %s", selector);   bb_error_msg_and_die("can't parse %s", selector);
96  #if  ENABLE_FEATURE_NAMEIF_EXTENDED  #if  ENABLE_FEATURE_NAMEIF_EXTENDED
97   found_selector++;   found_selector++;
98   };   };
# Line 144  int nameif_main(int argc, char **argv) Line 144  int nameif_main(int argc, char **argv)
144    
145   if (1 & getopt32(argv, "sc:", &fname)) {   if (1 & getopt32(argv, "sc:", &fname)) {
146   openlog(applet_name, 0, LOG_LOCAL0);   openlog(applet_name, 0, LOG_LOCAL0);
147   logmode = LOGMODE_SYSLOG;   /* Why not just "="? I assume logging to stderr
148     * can't hurt. 2>/dev/null if you don't like it: */
149     logmode |= LOGMODE_SYSLOG;
150   }   }
151   argc -= optind;   argc -= optind;
152   argv += optind;   argv += optind;
# Line 177  int nameif_main(int argc, char **argv) Line 179  int nameif_main(int argc, char **argv)
179    
180   /* Find the current interface name and copy it to ifr.ifr_name */   /* Find the current interface name and copy it to ifr.ifr_name */
181   memset(&ifr, 0, sizeof(struct ifreq));   memset(&ifr, 0, sizeof(struct ifreq));
182   strncpy(ifr.ifr_name, token[0], sizeof(ifr.ifr_name));   strncpy_IFNAMSIZ(ifr.ifr_name, token[0]);
183    
184  #if ENABLE_FEATURE_NAMEIF_EXTENDED  #if ENABLE_FEATURE_NAMEIF_EXTENDED
185   /* Check for driver etc. */   /* Check for driver etc. */
# Line 209  int nameif_main(int argc, char **argv) Line 211  int nameif_main(int argc, char **argv)
211   if (strcmp(ifr.ifr_name, ch->ifname) != 0) {   if (strcmp(ifr.ifr_name, ch->ifname) != 0) {
212   strcpy(ifr.ifr_newname, ch->ifname);   strcpy(ifr.ifr_newname, ch->ifname);
213   ioctl_or_perror_and_die(ctl_sk, SIOCSIFNAME, &ifr,   ioctl_or_perror_and_die(ctl_sk, SIOCSIFNAME, &ifr,
214   "cannot change ifname %s to %s",   "can't change ifname %s to %s",
215   ifr.ifr_name, ch->ifname);   ifr.ifr_name, ch->ifname);
216   }   }
217   /* Remove list entry of renamed interface */   /* Remove list entry of renamed interface */

Legend:
Removed from v.983  
changed lines
  Added in v.984