Changeset View
Changeset View
Standalone View
Standalone View
head/sbin/ifconfig/ifconfig.c
Show First 20 Lines • Show All 498 Lines • ▼ Show 20 Lines | #ifdef JAIL | ||||
if (iflen >= sizeof(name)) | if (iflen >= sizeof(name)) | ||||
errx(1, "%s: interface name too long", | errx(1, "%s: interface name too long", | ||||
ifname); | ifname); | ||||
ifconfig(argc, argv, 0, NULL); | ifconfig(argc, argv, 0, NULL); | ||||
exit(exit_code); | exit(exit_code); | ||||
} | } | ||||
#endif | #endif | ||||
errx(1, "interface %s does not exist", ifname); | errx(1, "interface %s does not exist", ifname); | ||||
} else { | |||||
/* | |||||
* Do not allow use `create` command as hostname if | |||||
* address family is not specified. | |||||
*/ | |||||
if (argc > 0 && (strcmp(argv[0], "create") == 0 || | |||||
strcmp(argv[0], "plumb") == 0)) { | |||||
if (argc == 1) | |||||
errx(1, "interface %s already exist", | |||||
yuripv: grammar nit: exists | |||||
ifname); | |||||
argc--, argv++; | |||||
} | |||||
} | } | ||||
} | } | ||||
/* Check for address family */ | /* Check for address family */ | ||||
if (argc > 0) { | if (argc > 0) { | ||||
afp = af_getbyname(*argv); | afp = af_getbyname(*argv); | ||||
if (afp != NULL) | if (afp != NULL) | ||||
argc--, argv++; | argc--, argv++; | ||||
▲ Show 20 Lines • Show All 992 Lines • Show Last 20 Lines |
grammar nit: exists