diff options
author | jeff <jeff@FreeBSD.org> | 2011-03-21 09:40:01 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2011-03-21 09:40:01 +0000 |
commit | 2d7d8c05e7404fbebf1f0fe24c13bc5bb58d2338 (patch) | |
tree | 79d67d85de5b498560d0272509bd0b1bfccf7d86 /usr.sbin | |
parent | 3420a736119b646db3defc2c3e24d534e35d73a0 (diff) | |
download | FreeBSD-src-2d7d8c05e7404fbebf1f0fe24c13bc5bb58d2338.zip FreeBSD-src-2d7d8c05e7404fbebf1f0fe24c13bc5bb58d2338.tar.gz |
- Merge changes to the base system to support OFED. These include
a wider arg2 for sysctl, updates to vlan code, IFT_INFINIBAND,
and other miscellaneous small features.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/config/config.h | 1 | ||||
-rw-r--r-- | usr.sbin/config/mkmakefile.c | 49 | ||||
-rw-r--r-- | usr.sbin/ndp/ndp.c | 8 |
3 files changed, 42 insertions, 16 deletions
diff --git a/usr.sbin/config/config.h b/usr.sbin/config/config.h index 4abb567..6d66167 100644 --- a/usr.sbin/config/config.h +++ b/usr.sbin/config/config.h @@ -53,6 +53,7 @@ struct file_list { char *f_depends; /* additional dependancies */ char *f_clean; /* File list to add to clean rule */ char *f_warn; /* warning message */ + const char *f_objprefix; /* prefix string for object name */ }; struct files_name { diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c index dd7aaa9..2372839 100644 --- a/usr.sbin/config/mkmakefile.c +++ b/usr.sbin/config/mkmakefile.c @@ -312,6 +312,7 @@ read_file(char *fname) struct device *dp; struct opt *op; char *wd, *this, *compilewith, *depends, *clean, *warning; + const char *objprefix; int compile, match, nreqs, std, filetype, imp_rule, no_obj, before_depend, mandatory, nowerror; @@ -326,6 +327,7 @@ next: * [ compile-with "compile rule" [no-implicit-rule] ] * [ dependency "dependency-list"] [ before-depend ] * [ clean "file-list"] [ warning "text warning" ] + * [ obj-prefix "file prefix"] */ wd = get_word(fp); if (wd == (char *)EOF) { @@ -373,6 +375,7 @@ next: before_depend = 0; nowerror = 0; filetype = NORMAL; + objprefix = ""; if (eq(wd, "standard")) { std = 1; /* @@ -467,6 +470,16 @@ nextparam: warning = ns(wd); goto nextparam; } + if (eq(wd, "obj-prefix")) { + next_quoted_word(fp, wd); + if (wd == 0) { + printf("%s: %s missing object prefix string.\n", + fname, this); + exit(1); + } + objprefix = ns(wd); + goto nextparam; + } nreqs++; if (eq(wd, "local")) { filetype = LOCAL; @@ -535,6 +548,7 @@ doneparam: tp->f_depends = depends; tp->f_clean = clean; tp->f_warn = warning; + tp->f_objprefix = objprefix; goto next; } @@ -619,11 +633,12 @@ do_objs(FILE *fp) cp = sp + (len = strlen(sp)) - 1; och = *cp; *cp = 'o'; + len += strlen(tp->f_objprefix); if (len + lpos > 72) { lpos = 8; fprintf(fp, "\\\n\t"); } - fprintf(fp, "%s ", sp); + fprintf(fp, "%s%s ", tp->f_objprefix, sp); lpos += len + 1; *cp = och; } @@ -699,30 +714,33 @@ do_rules(FILE *f) och = *cp; if (ftp->f_flags & NO_IMPLCT_RULE) { if (ftp->f_depends) - fprintf(f, "%s: %s\n", np, ftp->f_depends); + fprintf(f, "%s%s: %s\n", + ftp->f_objprefix, np, ftp->f_depends); else - fprintf(f, "%s: \n", np); + fprintf(f, "%s%s: \n", ftp->f_objprefix, np); } else { *cp = '\0'; if (och == 'o') { - fprintf(f, "%so:\n\t-cp $S/%so .\n\n", - tail(np), np); + fprintf(f, "%s%so:\n\t-cp $S/%so .\n\n", + ftp->f_objprefix, tail(np), np); continue; } if (ftp->f_depends) { - fprintf(f, "%sln: $S/%s%c %s\n", tail(np), - np, och, ftp->f_depends); + fprintf(f, "%s%sln: $S/%s%c %s\n", + ftp->f_objprefix, tail(np), np, och, + ftp->f_depends); fprintf(f, "\t${NORMAL_LINT}\n\n"); - fprintf(f, "%so: $S/%s%c %s\n", tail(np), - np, och, ftp->f_depends); + fprintf(f, "%s%so: $S/%s%c %s\n", + ftp->f_objprefix, tail(np), np, och, + ftp->f_depends); } else { - fprintf(f, "%sln: $S/%s%c\n", tail(np), - np, och); + fprintf(f, "%s%sln: $S/%s%c\n", + ftp->f_objprefix, tail(np), np, och); fprintf(f, "\t${NORMAL_LINT}\n\n"); - fprintf(f, "%so: $S/%s%c\n", tail(np), - np, och); + fprintf(f, "%s%so: $S/%s%c\n", + ftp->f_objprefix, tail(np), np, och); } } compilewith = ftp->f_compilewith; @@ -750,7 +768,10 @@ do_rules(FILE *f) compilewith = cmd; } *cp = och; - fprintf(f, "\t%s\n\n", compilewith); + if (strlen(ftp->f_objprefix)) + fprintf(f, "\t%s $S/%s\n\n", compilewith, np); + else + fprintf(f, "\t%s\n\n", compilewith); } } diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c index 1f62230..e245ac2 100644 --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -822,11 +822,15 @@ static char * ether_str(struct sockaddr_dl *sdl) { static char hbuf[NI_MAXHOST]; + char *cp; - if (sdl->sdl_alen > 0) + if (sdl->sdl_alen == ETHER_ADDR_LEN) { strlcpy(hbuf, ether_ntoa((struct ether_addr *)LLADDR(sdl)), sizeof(hbuf)); - else + } else if (sdl->sdl_alen) { + int n = sdl->sdl_nlen > 0 ? sdl->sdl_nlen + 1 : 0; + snprintf(hbuf, sizeof(hbuf), "%s", link_ntoa(sdl) + n); + } else snprintf(hbuf, sizeof(hbuf), "(incomplete)"); return(hbuf); |