diff options
author | sjg <sjg@FreeBSD.org> | 2014-05-08 23:54:15 +0000 |
---|---|---|
committer | sjg <sjg@FreeBSD.org> | 2014-05-08 23:54:15 +0000 |
commit | ed3fc70bf5a8edaf648093b11acca450802244ef (patch) | |
tree | 8ce0ddd0e6f508bd20c77429c448969589170fae /sbin | |
parent | d4e443e0426fee44056ba3c1123455666d083aef (diff) | |
parent | a2e6be0add027bf3e713c0d56ba9715b83a01144 (diff) | |
download | FreeBSD-src-ed3fc70bf5a8edaf648093b11acca450802244ef.zip FreeBSD-src-ed3fc70bf5a8edaf648093b11acca450802244ef.tar.gz |
Merge from head
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/Makefile | 2 | ||||
-rw-r--r-- | sbin/Makefile.inc | 2 | ||||
-rw-r--r-- | sbin/atm/atmconfig/Makefile | 2 | ||||
-rw-r--r-- | sbin/dhclient/Makefile | 2 | ||||
-rw-r--r-- | sbin/geom/class/Makefile | 2 | ||||
-rw-r--r-- | sbin/ggate/Makefile | 2 | ||||
-rw-r--r-- | sbin/growfs/Makefile | 2 | ||||
-rw-r--r-- | sbin/gvinum/gvinum.8 | 4 | ||||
-rw-r--r-- | sbin/gvinum/gvinum.c | 252 | ||||
-rw-r--r-- | sbin/gvinum/gvinum.h | 3 | ||||
-rw-r--r-- | sbin/hastctl/Makefile | 2 | ||||
-rw-r--r-- | sbin/hastd/Makefile | 2 | ||||
-rw-r--r-- | sbin/ifconfig/Makefile | 6 | ||||
-rw-r--r-- | sbin/ifconfig/tests/Makefile | 9 | ||||
-rwxr-xr-x | sbin/ifconfig/tests/fibs_test.sh | 126 | ||||
-rw-r--r-- | sbin/ipfw/Makefile | 2 | ||||
-rw-r--r-- | sbin/mdconfig/Makefile | 2 | ||||
-rw-r--r-- | sbin/newfs_msdos/newfs_msdos.c | 62 | ||||
-rw-r--r-- | sbin/pfctl/Makefile | 2 | ||||
-rw-r--r-- | sbin/ping/Makefile | 2 | ||||
-rw-r--r-- | sbin/route/Makefile | 2 | ||||
-rw-r--r-- | sbin/route/route.c | 2 | ||||
-rw-r--r-- | sbin/setkey/Makefile | 2 |
23 files changed, 182 insertions, 312 deletions
diff --git a/sbin/Makefile b/sbin/Makefile index 1548155..3725270 100644 --- a/sbin/Makefile +++ b/sbin/Makefile @@ -1,7 +1,7 @@ # @(#)Makefile 8.5 (Berkeley) 3/31/94 # $FreeBSD$ -.include <bsd.own.mk> +.include <src.opts.mk> # XXX MISSING: icheck ncheck diff --git a/sbin/Makefile.inc b/sbin/Makefile.inc index e506f9c..896c64c 100644 --- a/sbin/Makefile.inc +++ b/sbin/Makefile.inc @@ -1,7 +1,7 @@ # @(#)Makefile.inc 8.1 (Berkeley) 6/8/93 # $FreeBSD$ -.include <bsd.own.mk> +.include <src.opts.mk> BINDIR?= /sbin WARNS?= 6 diff --git a/sbin/atm/atmconfig/Makefile b/sbin/atm/atmconfig/Makefile index b2857c9..3e42d3f 100644 --- a/sbin/atm/atmconfig/Makefile +++ b/sbin/atm/atmconfig/Makefile @@ -5,7 +5,7 @@ # # $FreeBSD$ -.include <bsd.own.mk> +.include <src.opts.mk> PROG= atmconfig .ifndef RESCUE diff --git a/sbin/dhclient/Makefile b/sbin/dhclient/Makefile index 57c9211..09f19db 100644 --- a/sbin/dhclient/Makefile +++ b/sbin/dhclient/Makefile @@ -31,7 +31,7 @@ # OF THE POSSIBILITY OF SUCH DAMAGE. # -.include <bsd.own.mk> +.include <src.opts.mk> SRCS= dhclient.c clparse.c alloc.c dispatch.c hash.c bpf.c options.c \ tree.c conflex.c errwarn.c inet.c packet.c convert.c tables.c \ diff --git a/sbin/geom/class/Makefile b/sbin/geom/class/Makefile index 912561f..a7ed1b9 100644 --- a/sbin/geom/class/Makefile +++ b/sbin/geom/class/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -.include <bsd.own.mk> +.include <src.opts.mk> SUBDIR= cache SUBDIR+=concat diff --git a/sbin/ggate/Makefile b/sbin/ggate/Makefile index 8f889f1..b463359 100644 --- a/sbin/ggate/Makefile +++ b/sbin/ggate/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -.include <bsd.own.mk> +.include <src.opts.mk> SUBDIR= ${_ggatec} \ ${_ggated} \ diff --git a/sbin/growfs/Makefile b/sbin/growfs/Makefile index 58ce41d..025771f 100644 --- a/sbin/growfs/Makefile +++ b/sbin/growfs/Makefile @@ -6,7 +6,7 @@ #GFSDBG= -.include <bsd.own.mk> +.include <src.opts.mk> .PATH: ${.CURDIR}/../mount diff --git a/sbin/gvinum/gvinum.8 b/sbin/gvinum/gvinum.8 index d1d10d7..703a810 100644 --- a/sbin/gvinum/gvinum.8 +++ b/sbin/gvinum/gvinum.8 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 1, 2013 +.Dd May 6, 2014 .Dt GVINUM 8 .Os .Sh NAME @@ -168,7 +168,7 @@ the beginning of the plex if the .Fl f flag is specified, or otherwise at the location of the parity check pointer. All subdisks in the plex must be up for a parity check. -.It Ic resetconfig +.It Ic resetconfig Oo Fl f Oc Reset the complete .Nm configuration. diff --git a/sbin/gvinum/gvinum.c b/sbin/gvinum/gvinum.c index 5760d2b..4feaa81 100644 --- a/sbin/gvinum/gvinum.c +++ b/sbin/gvinum/gvinum.c @@ -58,35 +58,36 @@ #include "gvinum.h" -void gvinum_attach(int, char **); -void gvinum_concat(int, char **); -void gvinum_create(int, char **); -void gvinum_detach(int, char **); -void gvinum_grow(int, char **); -void gvinum_help(void); -void gvinum_list(int, char **); -void gvinum_move(int, char **); -void gvinum_mirror(int, char **); -void gvinum_parityop(int, char **, int); -void gvinum_printconfig(int, char **); -void gvinum_raid5(int, char **); -void gvinum_rename(int, char **); -void gvinum_resetconfig(void); -void gvinum_rm(int, char **); -void gvinum_saveconfig(void); -void gvinum_setstate(int, char **); -void gvinum_start(int, char **); -void gvinum_stop(int, char **); -void gvinum_stripe(int, char **); -void parseline(int, char **); -void printconfig(FILE *, char *); - -char *create_drive(char *); -void create_volume(int, char **, char *); -char *find_name(const char *, int, int); -char *find_pattern(char *, char *); -void copy_device(struct gv_drive *, const char *); -#define find_drive() find_name("gvinumdrive", GV_TYPE_DRIVE, GV_MAXDRIVENAME) +static void gvinum_attach(int, char * const *); +static void gvinum_concat(int, char * const *); +static void gvinum_create(int, char * const *); +static void gvinum_detach(int, char * const *); +static void gvinum_grow(int, char * const *); +static void gvinum_help(void); +static void gvinum_list(int, char * const *); +static void gvinum_move(int, char * const *); +static void gvinum_mirror(int, char * const *); +static void gvinum_parityop(int, char * const * , int); +static void gvinum_printconfig(int, char * const *); +static void gvinum_raid5(int, char * const *); +static void gvinum_rename(int, char * const *); +static void gvinum_resetconfig(int, char * const *); +static void gvinum_rm(int, char * const *); +static void gvinum_saveconfig(void); +static void gvinum_setstate(int, char * const *); +static void gvinum_start(int, char * const *); +static void gvinum_stop(int, char * const *); +static void gvinum_stripe(int, char * const *); +static void parseline(int, char * const *); +static void printconfig(FILE *, const char *); + +static char *create_drive(const char *); +static void create_volume(int, char * const * , const char *); +static char *find_name(const char *, int, int); +static const char *find_pattern(char *, const char *); +static void copy_device(struct gv_drive *, const char *); +#define find_drive() \ + find_name("gvinumdrive", GV_TYPE_DRIVE, GV_MAXDRIVENAME) int main(int argc, char **argv) @@ -95,8 +96,10 @@ main(int argc, char **argv) char buffer[BUFSIZ], *inputline, *token[GV_MAXARGS]; /* Load the module if necessary. */ - if (kldfind(GVINUMMOD) < 0 && kldload(GVINUMMOD) < 0) - err(1, GVINUMMOD ": Kernel module not available"); + if (modfind(GVINUMMOD) < 0) { + if (kldload(GVINUMKLD) < 0 && modfind(GVINUMMOD) < 0) + err(1, GVINUMKLD ": Kernel module not available"); + } /* Arguments given on the command line. */ if (argc > 1) { @@ -130,8 +133,8 @@ main(int argc, char **argv) } /* Attach a plex to a volume or a subdisk to a plex. */ -void -gvinum_attach(int argc, char **argv) +static void +gvinum_attach(int argc, char * const *argv) { struct gctl_req *req; const char *errstr; @@ -167,8 +170,8 @@ gvinum_attach(int argc, char **argv) gctl_free(req); } -void -gvinum_create(int argc, char **argv) +static void +gvinum_create(int argc, char * const *argv) { struct gctl_req *req; struct gv_drive *d; @@ -191,8 +194,8 @@ gvinum_create(int argc, char **argv) flags |= GV_FLAG_F; /* Else it must be a file. */ } else { - if ((tmp = fopen(argv[1], "r")) == NULL) { - warn("can't open '%s' for reading", argv[1]); + if ((tmp = fopen(argv[i], "r")) == NULL) { + warn("can't open '%s' for reading", argv[i]); return; } } @@ -400,8 +403,8 @@ gvinum_create(int argc, char **argv) } /* Create a concatenated volume. */ -void -gvinum_concat(int argc, char **argv) +static void +gvinum_concat(int argc, char * const *argv) { if (argc < 2) { @@ -411,10 +414,9 @@ gvinum_concat(int argc, char **argv) create_volume(argc, argv, "concat"); } - /* Create a drive quick and dirty. */ -char * -create_drive(char *device) +static char * +create_drive(const char *device) { struct gv_drive *d; struct gctl_req *req; @@ -477,12 +479,12 @@ create_drive(char *device) return (drivename); } -/* +/* * General routine for creating a volume. Mainly for use by concat, mirror, * raid5 and stripe commands. */ -void -create_volume(int argc, char **argv, char *verb) +static void +create_volume(int argc, char * const *argv, const char *verb) { struct gctl_req *req; const char *errstr; @@ -516,7 +518,7 @@ create_volume(int argc, char **argv, char *verb) snprintf(buf, sizeof(buf), "drive%d", drives++); /* First we create the drive. */ - drivename = create_drive(argv[i]); + drivename = create_drive(argv[i]); if (drivename == NULL) goto bad; /* Then we add it to the request. */ @@ -532,7 +534,7 @@ create_volume(int argc, char **argv, char *verb) /* Then we send a request to actually create the volumes. */ gctl_ro_param(req, "verb", -1, verb); - gctl_ro_param(req, "flags", sizeof(int), &flags); + gctl_ro_param(req, "flags", sizeof(int), &flags); gctl_ro_param(req, "drives", sizeof(int), &drives); gctl_ro_param(req, "name", -1, volname); errstr = gctl_issue(req); @@ -543,8 +545,8 @@ bad: } /* Parse a line of the config, return the word after <pattern>. */ -char * -find_pattern(char *line, char *pattern) +static const char * +find_pattern(char *line, const char *pattern) { char *ptr; @@ -561,12 +563,12 @@ find_pattern(char *line, char *pattern) } /* Find a free name for an object given a prefix. */ -char * +static char * find_name(const char *prefix, int type, int namelen) { struct gctl_req *req; - char comment[1], buf[GV_CFG_LEN - 1], *name, *sname, *ptr; - const char *errstr; + char comment[1], buf[GV_CFG_LEN - 1], *sname, *ptr; + const char *errstr, *name; int i, n, begin, len, conflict; char line[1024]; @@ -631,9 +633,10 @@ find_name(const char *prefix, int type, int namelen) return (NULL); } -void +static void copy_device(struct gv_drive *d, const char *device) { + if (strncmp(device, "/dev/", 5) == 0) strlcpy(d->device, (device + 5), sizeof(d->device)); else @@ -641,8 +644,8 @@ copy_device(struct gv_drive *d, const char *device) } /* Detach a plex or subdisk from its parent. */ -void -gvinum_detach(int argc, char **argv) +static void +gvinum_detach(int argc, char * const *argv) { const char *errstr; struct gctl_req *req; @@ -652,7 +655,7 @@ gvinum_detach(int argc, char **argv) optreset = 1; optind = 1; while ((i = getopt(argc, argv, "f")) != -1) { - switch(i) { + switch (i) { case 'f': flags |= GV_FLAG_F; break; @@ -680,9 +683,10 @@ gvinum_detach(int argc, char **argv) gctl_free(req); } -void +static void gvinum_help(void) { + printf("COMMANDS\n" "checkparity [-f] plex\n" " Check the parity blocks of a RAID-5 plex.\n" @@ -721,7 +725,7 @@ gvinum_help(void) " Change the name of the specified object.\n" "rebuildparity plex [-f]\n" " Rebuild the parity blocks of a RAID-5 plex.\n" - "resetconfig\n" + "resetconfig [-f]\n" " Reset the complete gvinum configuration\n" "rm [-r] [-f] volume | plex | subdisk | drive\n" " Remove an object.\n" @@ -737,12 +741,10 @@ gvinum_help(void) "stripe [-fv] [-n name] drives\n" " Create a striped volume from the specified drives.\n" ); - - return; } -void -gvinum_setstate(int argc, char **argv) +static void +gvinum_setstate(int argc, char * const *argv) { struct gctl_req *req; int flags, i; @@ -796,8 +798,8 @@ gvinum_setstate(int argc, char **argv) gctl_free(req); } -void -gvinum_list(int argc, char **argv) +static void +gvinum_list(int argc, char * const *argv) { struct gctl_req *req; int flags, i, j; @@ -858,12 +860,11 @@ gvinum_list(int argc, char **argv) printf("%s", config); gctl_free(req); - return; } /* Create a mirrored volume. */ -void -gvinum_mirror(int argc, char **argv) +static void +gvinum_mirror(int argc, char * const *argv) { if (argc < 2) { @@ -874,8 +875,8 @@ gvinum_mirror(int argc, char **argv) } /* Note that move is currently of form '[-r] target object [...]' */ -void -gvinum_move(int argc, char **argv) +static void +gvinum_move(int argc, char * const *argv) { struct gctl_req *req; const char *errstr; @@ -925,17 +926,17 @@ gvinum_move(int argc, char **argv) if (errstr != NULL) warnx("can't move object(s): %s", errstr); gctl_free(req); - return; } -void -gvinum_printconfig(int argc, char **argv) +static void +gvinum_printconfig(int argc, char * const *argv) { + printconfig(stdout, ""); } -void -gvinum_parityop(int argc, char **argv, int rebuild) +static void +gvinum_parityop(int argc, char * const *argv, int rebuild) { struct gctl_req *req; int flags, i; @@ -959,7 +960,6 @@ gvinum_parityop(int argc, char **argv, int rebuild) case 'v': flags |= GV_FLAG_V; break; - case '?': default: warnx("invalid flag '%c'", i); return; @@ -987,8 +987,8 @@ gvinum_parityop(int argc, char **argv, int rebuild) } /* Create a RAID-5 volume. */ -void -gvinum_raid5(int argc, char **argv) +static void +gvinum_raid5(int argc, char * const *argv) { if (argc < 2) { @@ -998,9 +998,8 @@ gvinum_raid5(int argc, char **argv) create_volume(argc, argv, "raid5"); } - -void -gvinum_rename(int argc, char **argv) +static void +gvinum_rename(int argc, char * const *argv) { struct gctl_req *req; const char *errstr; @@ -1016,7 +1015,6 @@ gvinum_rename(int argc, char **argv) case 'r': flags |= GV_FLAG_R; break; - case '?': default: return; } @@ -1049,11 +1047,10 @@ gvinum_rename(int argc, char **argv) if (errstr != NULL) warnx("can't rename object: %s", errstr); gctl_free(req); - return; } -void -gvinum_rm(int argc, char **argv) +static void +gvinum_rm(int argc, char * const *argv) { struct gctl_req *req; int flags, i, j; @@ -1071,7 +1068,6 @@ gvinum_rm(int argc, char **argv) case 'r': flags |= GV_FLAG_R; break; - case '?': default: return; } @@ -1099,27 +1095,41 @@ gvinum_rm(int argc, char **argv) gctl_free(req); } -void -gvinum_resetconfig(void) +static void +gvinum_resetconfig(int argc, char * const *argv) { struct gctl_req *req; const char *errstr; char reply[32]; + int flags, i; - if (!isatty(STDIN_FILENO)) { - warn("Please enter this command from a tty device\n"); - return; + flags = 0; + while ((i = getopt(argc, argv, "f")) != -1) { + switch (i) { + case 'f': + flags |= GV_FLAG_F; + break; + default: + warn("invalid flag: %c", i); + return; + } } - printf(" WARNING! This command will completely wipe out your gvinum" - "configuration.\n" - " All data will be lost. If you really want to do this," - " enter the text\n\n" - " NO FUTURE\n" - " Enter text -> "); - fgets(reply, sizeof(reply), stdin); - if (strcmp(reply, "NO FUTURE\n")) { - printf("\n No change\n"); - return; + if ((flags & GV_FLAG_F) == 0) { + if (!isatty(STDIN_FILENO)) { + warn("Please enter this command from a tty device\n"); + return; + } + printf(" WARNING! This command will completely wipe out" + " your gvinum configuration.\n" + " All data will be lost. If you really want to do this," + " enter the text\n\n" + " NO FUTURE\n" + " Enter text -> "); + fgets(reply, sizeof(reply), stdin); + if (strcmp(reply, "NO FUTURE\n")) { + printf("\n No change\n"); + return; + } } req = gctl_get_handle(); gctl_ro_param(req, "class", -1, "VINUM"); @@ -1134,7 +1144,7 @@ gvinum_resetconfig(void) printf("gvinum configuration obliterated\n"); } -void +static void gvinum_saveconfig(void) { struct gctl_req *req; @@ -1149,8 +1159,8 @@ gvinum_saveconfig(void) gctl_free(req); } -void -gvinum_start(int argc, char **argv) +static void +gvinum_start(int argc, char * const *argv) { struct gctl_req *req; int i, initsize, j; @@ -1170,7 +1180,6 @@ gvinum_start(int argc, char **argv) case 'S': initsize = atoi(optarg); break; - case '?': default: return; } @@ -1202,14 +1211,15 @@ gvinum_start(int argc, char **argv) gctl_free(req); } -void -gvinum_stop(int argc, char **argv) +static void +gvinum_stop(int argc, char * const *argv) { int err, fileid; - fileid = kldfind(GVINUMMOD); + fileid = kldfind(GVINUMKLD); if (fileid == -1) { - warn("cannot find " GVINUMMOD); + if (modfind(GVINUMMOD) < 0) + warn("cannot find " GVINUMKLD); return; } @@ -1219,7 +1229,7 @@ gvinum_stop(int argc, char **argv) * event thread will be free for the g_wither_geom() call from * gv_unload(). It's silly, but it works. */ - printf("unloading " GVINUMMOD " kernel module... "); + printf("unloading " GVINUMKLD " kernel module... "); fflush(stdout); if ((err = kldunload(fileid)) != 0 && (errno == EAGAIN)) { sleep(1); @@ -1227,7 +1237,7 @@ gvinum_stop(int argc, char **argv) } if (err != 0) { printf(" failed!\n"); - warn("cannot unload " GVINUMMOD); + warn("cannot unload " GVINUMKLD); return; } @@ -1236,8 +1246,8 @@ gvinum_stop(int argc, char **argv) } /* Create a striped volume. */ -void -gvinum_stripe(int argc, char **argv) +static void +gvinum_stripe(int argc, char * const *argv) { if (argc < 2) { @@ -1248,8 +1258,8 @@ gvinum_stripe(int argc, char **argv) } /* Grow a subdisk by adding disk backed by provider. */ -void -gvinum_grow(int argc, char **argv) +static void +gvinum_grow(int argc, char * const *argv) { struct gctl_req *req; char *drive, *sdname; @@ -1259,6 +1269,7 @@ gvinum_grow(int argc, char **argv) const char *errstr; int drives, volumes, plexes, subdisks, flags; + flags = 0; drives = volumes = plexes = subdisks = 0; if (argc < 3) { warnx("usage:\tgrow plex drive\n"); @@ -1326,9 +1337,10 @@ gvinum_grow(int argc, char **argv) gctl_free(req); } -void -parseline(int argc, char **argv) +static void +parseline(int argc, char * const *argv) { + if (argc <= 0) return; @@ -1369,7 +1381,7 @@ parseline(int argc, char **argv) else if (!strcmp(argv[0], "rename")) gvinum_rename(argc, argv); else if (!strcmp(argv[0], "resetconfig")) - gvinum_resetconfig(); + gvinum_resetconfig(argc, argv); else if (!strcmp(argv[0], "rm")) gvinum_rm(argc, argv); else if (!strcmp(argv[0], "saveconfig")) @@ -1388,8 +1400,6 @@ parseline(int argc, char **argv) gvinum_parityop(argc, argv, 1); else printf("unknown command '%s'\n", argv[0]); - - return; } /* @@ -1397,8 +1407,8 @@ parseline(int argc, char **argv) * gvinum_create when called without an argument, in order to give the user * something to edit. */ -void -printconfig(FILE *of, char *comment) +static void +printconfig(FILE *of, const char *comment) { struct gctl_req *req; struct utsname uname_s; diff --git a/sbin/gvinum/gvinum.h b/sbin/gvinum/gvinum.h index d1b45a0..8b72eea 100644 --- a/sbin/gvinum/gvinum.h +++ b/sbin/gvinum/gvinum.h @@ -36,4 +36,5 @@ /* $FreeBSD$ */ -#define GVINUMMOD "geom_vinum" +#define GVINUMMOD "g_vinum" +#define GVINUMKLD "geom_vinum" diff --git a/sbin/hastctl/Makefile b/sbin/hastctl/Makefile index 02531e6..89b972e 100644 --- a/sbin/hastctl/Makefile +++ b/sbin/hastctl/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -.include <bsd.own.mk> +.include <src.opts.mk> .PATH: ${.CURDIR}/../hastd diff --git a/sbin/hastd/Makefile b/sbin/hastd/Makefile index 7ff6ee8..306c83a 100644 --- a/sbin/hastd/Makefile +++ b/sbin/hastd/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -.include <bsd.own.mk> +.include <src.opts.mk> PROG= hastd SRCS= activemap.c diff --git a/sbin/ifconfig/Makefile b/sbin/ifconfig/Makefile index 44c2319..aae6724 100644 --- a/sbin/ifconfig/Makefile +++ b/sbin/ifconfig/Makefile @@ -1,7 +1,7 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/5/93 # $FreeBSD$ -.include <bsd.own.mk> +.include <src.opts.mk> PROG= ifconfig @@ -63,8 +63,4 @@ MAN= ifconfig.8 CFLAGS+= -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wnested-externs WARNS?= 2 -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif - .include <bsd.prog.mk> diff --git a/sbin/ifconfig/tests/Makefile b/sbin/ifconfig/tests/Makefile deleted file mode 100644 index 9b7aa07..0000000 --- a/sbin/ifconfig/tests/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# $FreeBSD$ - -.include <bsd.own.mk> - -TESTSDIR= ${TESTSBASE}/sbin/ifconfig - -ATF_TESTS_SH= fibs_test - -.include <bsd.test.mk> diff --git a/sbin/ifconfig/tests/fibs_test.sh b/sbin/ifconfig/tests/fibs_test.sh deleted file mode 100755 index 2a25458..0000000 --- a/sbin/ifconfig/tests/fibs_test.sh +++ /dev/null @@ -1,126 +0,0 @@ -# -# Copyright (c) 2014 Spectra Logic Corporation -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions, and the following disclaimer, -# without modification. -# 2. Redistributions in binary form must reproduce at minimum a disclaimer -# substantially similar to the "NO WARRANTY" disclaimer below -# ("Disclaimer") and any redistribution must be conditioned upon -# including a substantially similar Disclaimer requirement for further -# binary redistribution. -# -# NO WARRANTY -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGES. -# -# Authors: Alan Somers (Spectra Logic Corporation) -# -# $FreeBSD$ - - -# Regression test for bin/187551 -atf_test_case process_fib cleanup -process_fib_head() -{ - atf_set "descr" "ifconfig will set its process fib whenever configuring an interface with nondefault fib" - atf_set "require.user" "root" - atf_set "require.config" "fibs" -} -process_fib_body() -{ - atf_expect_fail "bin/187551 ifconfig should change its process fib when configuring an interface with nondefault fib" - # Configure the TAP interface to use an RFC5737 nonrouteable address - # and a non-default fib - ADDR="192.0.2.2" - SUBNET="192.0.2.0" - MASK="24" - - # Check system configuration - if [ 0 != `sysctl -n net.add_addr_allfibs` ]; then - atf_skip "This test requires net.add_addr_allfibs=0" - fi - get_fibs 1 - - # Configure a TAP interface - get_tap - ktrace ifconfig $TAP ${ADDR}/${MASK} fib $FIB0 - if kdump -s | egrep -q 'CALL[[:space:]]+setfib'; then - atf_pass - else - atf_fail "ifconfig never called setfib(2)" - fi -} - -process_fib_cleanup() -{ - cleanup_tap -} - -atf_init_test_cases() -{ - atf_add_test_case process_fib -} - - -# parameter numfibs The number of fibs to lookup -get_fibs() -{ - NUMFIBS=$1 - net_fibs=`sysctl -n net.fibs` - i=0 - while [ $i -lt "$NUMFIBS" ]; do - fib=`atf_config_get "fibs" | \ - awk -v i=$(( i + 1 )) '{print $i}'` - echo "fib is ${fib}" - eval FIB${i}=${fib} - if [ "$fib" -ge "$net_fibs" ]; then - atf_skip "The ${i}th configured fib is ${fib}, which is not less than net.fibs, which is ${net_fibs}" - fi - i=$(( $i + 1 )) - done -} - - - -# Creates a new tap(4) interface, registers it for cleanup, and returns the -# name via the environment variable TAP -get_tap() -{ - local TAPN=0 - while ! ifconfig tap${TAPN} create > /dev/null 2>&1; do - if [ "$TAPN" -ge 8 ]; then - atf_skip "Could not create a tap(4) interface" - else - TAPN=$(($TAPN + 1)) - fi - done - local TAPD=tap${TAPN} - # Record the TAP device so we can clean it up later - echo ${TAPD} >> "tap_devices_to_cleanup" - TAP=${TAPD} -} - - - - -cleanup_tap() -{ - for TAPD in `cat "tap_devices_to_cleanup"`; do - ifconfig ${TAPD} destroy - done -} - diff --git a/sbin/ipfw/Makefile b/sbin/ipfw/Makefile index 6aea26b..de27e3e 100644 --- a/sbin/ipfw/Makefile +++ b/sbin/ipfw/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -.include <bsd.own.mk> +.include <src.opts.mk> PROG= ipfw SRCS= ipfw2.c dummynet.c ipv6.c main.c nat.c diff --git a/sbin/mdconfig/Makefile b/sbin/mdconfig/Makefile index 4b9b940..69a688c 100644 --- a/sbin/mdconfig/Makefile +++ b/sbin/mdconfig/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -.include <bsd.own.mk> +.include <src.opts.mk> PROG= mdconfig MAN= mdconfig.8 diff --git a/sbin/newfs_msdos/newfs_msdos.c b/sbin/newfs_msdos/newfs_msdos.c index 1f5b438..4bfb219 100644 --- a/sbin/newfs_msdos/newfs_msdos.c +++ b/sbin/newfs_msdos/newfs_msdos.c @@ -51,50 +51,50 @@ static const char rcsid[] = #include <time.h> #include <unistd.h> -#define MAXU16 0xffff /* maximum unsigned 16-bit quantity */ -#define BPN 4 /* bits per nibble */ -#define NPB 2 /* nibbles per byte */ +#define MAXU16 0xffff /* maximum unsigned 16-bit quantity */ +#define BPN 4 /* bits per nibble */ +#define NPB 2 /* nibbles per byte */ -#define DOSMAGIC 0xaa55 /* DOS magic number */ -#define MINBPS 512 /* minimum bytes per sector */ -#define MAXSPC 128 /* maximum sectors per cluster */ -#define MAXNFT 16 /* maximum number of FATs */ -#define DEFBLK 4096 /* default block size */ -#define DEFBLK16 2048 /* default block size FAT16 */ -#define DEFRDE 512 /* default root directory entries */ -#define RESFTE 2 /* reserved FAT entries */ -#define MINCLS12 1U /* minimum FAT12 clusters */ -#define MINCLS16 0xff5U /* minimum FAT16 clusters */ -#define MINCLS32 0xfff5U /* minimum FAT32 clusters */ -#define MAXCLS12 0xff4U /* maximum FAT12 clusters */ -#define MAXCLS16 0xfff4U /* maximum FAT16 clusters */ -#define MAXCLS32 0xffffff4U /* maximum FAT32 clusters */ +#define DOSMAGIC 0xaa55 /* DOS magic number */ +#define MINBPS 512 /* minimum bytes per sector */ +#define MAXSPC 128 /* maximum sectors per cluster */ +#define MAXNFT 16 /* maximum number of FATs */ +#define DEFBLK 4096 /* default block size */ +#define DEFBLK16 2048 /* default block size FAT16 */ +#define DEFRDE 512 /* default root directory entries */ +#define RESFTE 2 /* reserved FAT entries */ +#define MINCLS12 1U /* minimum FAT12 clusters */ +#define MINCLS16 0xff5U /* minimum FAT16 clusters */ +#define MINCLS32 0xfff5U /* minimum FAT32 clusters */ +#define MAXCLS12 0xff4U /* maximum FAT12 clusters */ +#define MAXCLS16 0xfff4U /* maximum FAT16 clusters */ +#define MAXCLS32 0xffffff4U /* maximum FAT32 clusters */ -#define mincls(fat) ((fat) == 12 ? MINCLS12 : \ +#define mincls(fat) ((fat) == 12 ? MINCLS12 : \ (fat) == 16 ? MINCLS16 : \ MINCLS32) -#define maxcls(fat) ((fat) == 12 ? MAXCLS12 : \ +#define maxcls(fat) ((fat) == 12 ? MAXCLS12 : \ (fat) == 16 ? MAXCLS16 : \ MAXCLS32) -#define mk1(p, x) \ +#define mk1(p, x) \ (p) = (u_int8_t)(x) -#define mk2(p, x) \ +#define mk2(p, x) \ (p)[0] = (u_int8_t)(x), \ (p)[1] = (u_int8_t)((x) >> 010) -#define mk4(p, x) \ +#define mk4(p, x) \ (p)[0] = (u_int8_t)(x), \ (p)[1] = (u_int8_t)((x) >> 010), \ (p)[2] = (u_int8_t)((x) >> 020), \ (p)[3] = (u_int8_t)((x) >> 030) -#define argto1(arg, lo, msg) argtou(arg, lo, 0xff, msg) -#define argto2(arg, lo, msg) argtou(arg, lo, 0xffff, msg) -#define argto4(arg, lo, msg) argtou(arg, lo, 0xffffffff, msg) -#define argtox(arg, lo, msg) argtou(arg, lo, UINT_MAX, msg) +#define argto1(arg, lo, msg) argtou(arg, lo, 0xff, msg) +#define argto2(arg, lo, msg) argtou(arg, lo, 0xffff, msg) +#define argto4(arg, lo, msg) argtou(arg, lo, 0xffffffff, msg) +#define argtox(arg, lo, msg) argtou(arg, lo, UINT_MAX, msg) struct bs { u_int8_t bsJump[3]; /* bootstrap entry point */ @@ -131,7 +131,7 @@ struct bsx { u_int8_t exReserved1; /* reserved */ u_int8_t exBootSignature; /* extended boot signature */ u_int8_t exVolumeID[4]; /* volume ID number */ - u_int8_t exVolumeLabel[11]; /* volume label */ + u_int8_t exVolumeLabel[11]; /* volume label */ u_int8_t exFileSysType[8]; /* file system type */ } __packed; @@ -164,7 +164,7 @@ struct bpb { u_int bpbBackup; /* backup boot sector */ }; -#define BPBGAP 0, 0, 0, 0, 0, 0 +#define BPBGAP 0, 0, 0, 0, 0, 0 static struct { const char *name; @@ -174,10 +174,10 @@ static struct { {"180", {512, 1, 1, 2, 64, 360, 0xfc, 2, 9, 1, BPBGAP}}, {"320", {512, 2, 1, 2, 112, 640, 0xff, 1, 8, 2, BPBGAP}}, {"360", {512, 2, 1, 2, 112, 720, 0xfd, 2, 9, 2, BPBGAP}}, - {"640", {512, 2, 1, 2, 112, 1280, 0xfb, 2, 8, 2, BPBGAP}}, + {"640", {512, 2, 1, 2, 112, 1280, 0xfb, 2, 8, 2, BPBGAP}}, {"720", {512, 2, 1, 2, 112, 1440, 0xf9, 3, 9, 2, BPBGAP}}, {"1200", {512, 1, 1, 2, 224, 2400, 0xf9, 7, 15, 2, BPBGAP}}, - {"1232", {1024,1, 1, 2, 192, 1232, 0xfe, 2, 8, 2, BPBGAP}}, + {"1232", {1024,1, 1, 2, 192, 1232, 0xfe, 2, 8, 2, BPBGAP}}, {"1440", {512, 1, 1, 2, 224, 2880, 0xf0, 9, 18, 2, BPBGAP}}, {"2880", {512, 2, 1, 2, 240, 5760, 0xf0, 9, 36, 2, BPBGAP}} }; @@ -1029,7 +1029,7 @@ usage(void) fprintf(stderr, "usage: newfs_msdos [ -options ] special [disktype]\n" "where the options are:\n" - "\t-@ create file system at specified offset\n" + "\t-@ create file system at specified offset\n" "\t-B get bootstrap from file\n" "\t-C create image file with specified size\n" "\t-F FAT type (12, 16, or 32)\n" diff --git a/sbin/pfctl/Makefile b/sbin/pfctl/Makefile index 5b3735c..937f403 100644 --- a/sbin/pfctl/Makefile +++ b/sbin/pfctl/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -.include <bsd.own.mk> +.include <src.opts.mk> # pf_ruleset.c is shared between kernel and pfctl .PATH: ${.CURDIR}/../../sys/netpfil/pf diff --git a/sbin/ping/Makefile b/sbin/ping/Makefile index c3dda69..a05efe3 100644 --- a/sbin/ping/Makefile +++ b/sbin/ping/Makefile @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/5/93 # $FreeBSD$ -.include <bsd.own.mk> +.include <src.opts.mk> PROG= ping MAN= ping.8 diff --git a/sbin/route/Makefile b/sbin/route/Makefile index 569d21a..25134e4 100644 --- a/sbin/route/Makefile +++ b/sbin/route/Makefile @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/5/93 # $FreeBSD$ -.include <bsd.own.mk> +.include <src.opts.mk> PROG= route MAN= route.8 diff --git a/sbin/route/route.c b/sbin/route/route.c index 794f143..9b3bb95 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -1727,8 +1727,6 @@ print_getmsg(struct rt_msghdr *rtm, int msglen, int fib) (sp[RTAX_IFP]->sa_family != AF_LINK || ((struct sockaddr_dl *)(void *)sp[RTAX_IFP])->sdl_nlen == 0)) sp[RTAX_IFP] = NULL; - if (sp[RTAX_DST] && sp[RTAX_NETMASK]) - sp[RTAX_NETMASK]->sa_family = sp[RTAX_DST]->sa_family; /* XXX */ if (sp[RTAX_DST]) (void)printf("destination: %s\n", routename(sp[RTAX_DST])); if (sp[RTAX_NETMASK]) diff --git a/sbin/setkey/Makefile b/sbin/setkey/Makefile index e2c93cc..bd04f07 100644 --- a/sbin/setkey/Makefile +++ b/sbin/setkey/Makefile @@ -27,7 +27,7 @@ # # $FreeBSD$ -.include <bsd.own.mk> +.include <src.opts.mk> PROG= setkey MAN= setkey.8 |