FreeBSD Bugzilla – Attachment 14807 Details for
Bug 27701
[PATCH] ifconfig: supported media looks bad & wastes space
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.50 KB, created by
brooks
on 2001-05-28 07:20:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
brooks
Created:
2001-05-28 07:20:01 UTC
Size:
3.50 KB
patch
obsolete
>Index: ifconfig.8 >=================================================================== >RCS file: /home/ncvs/src/sbin/ifconfig/ifconfig.8,v >retrieving revision 1.38 >diff -u -r1.38 ifconfig.8 >--- ifconfig.8 2001/05/26 09:26:01 1.38 >+++ ifconfig.8 2001/05/28 06:00:18 >@@ -41,6 +41,7 @@ > .Sh SYNOPSIS > .Nm > .Op Fl L >+.Op Fl m > .Ar interface > .Op Ar address_family > .Oo >@@ -52,6 +53,7 @@ > .Fl a > .Op Fl L > .Op Fl d >+.Op Fl m > .Op Fl u > .Op Ar address_family > .Nm >@@ -62,6 +64,7 @@ > .Nm > .Op Fl L > .Op Fl d >+.Op Fl m > .Op Fl u > .Sh DESCRIPTION > .Nm Ifconfig >@@ -530,6 +533,10 @@ > If the driver does supports the media selection system, the supported > media list will be included in the output. > .Pp >+If the >+.Fl m >+flag is passed before an interface name, ifconfig will display all >+of the supported media for the specified interface. > If > .Fl L > flag is supplied, address lifetime is displayed for IPv6 addresses, >Index: ifconfig.c >=================================================================== >RCS file: /home/ncvs/src/sbin/ifconfig/ifconfig.c,v >retrieving revision 1.61 >diff -u -r1.61 ifconfig.c >--- ifconfig.c 2001/05/26 09:26:01 1.61 >+++ ifconfig.c 2001/05/28 05:45:19 >@@ -134,6 +134,8 @@ > > struct afswtch; > >+int supmedia = 0; >+ > #ifdef INET6 > char addr_buf[MAXHOSTNAMELEN *2 + 1]; /*for getnameinfo()*/ > #endif >@@ -351,16 +353,16 @@ > fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", > "usage: ifconfig interface address_family [address [dest_address]]", > " [parameters]", >- " ifconfig -a [-d] [-u] [address_family]", >+ " ifconfig -a [-d] [-m] [-u] [address_family]", > " ifconfig -l [-d] [-u] [address_family]", >- " ifconfig [-d] [-u]"); >+ " ifconfig [-d] [-m] [-u]"); > #else > fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", > "usage: ifconfig [-L] interface address_family [address [dest_address]]", > " [parameters]", >- " ifconfig -a [-L] [-d] [-u] [address_family]", >+ " ifconfig -a [-L] [-d] [-m] [-u] [address_family]", > " ifconfig -l [-d] [-u] [address_family]", >- " ifconfig [-L] [-d] [-u]"); >+ " ifconfig [-L] [-d] [-m] [-u]"); > #endif > exit(1); > } >@@ -410,7 +412,7 @@ > uponly++; > break; > case 'm': /* show media choices in status */ >- /* ignored for compatibility */ >+ supmedia = 1; > break; > default: > usage(); >@@ -421,7 +423,7 @@ > argv += optind; > > /* -l cannot be used with -a or -m */ >- if (namesonly && all) >+ if (namesonly && (all || supmedia)) > usage(); > > /* nonsense.. */ >Index: ifconfig.h >=================================================================== >RCS file: /home/ncvs/src/sbin/ifconfig/ifconfig.h,v >retrieving revision 1.6 >diff -u -r1.6 ifconfig.h >--- ifconfig.h 2001/05/26 09:26:01 1.6 >+++ ifconfig.h 2001/05/28 05:39:35 >@@ -38,6 +38,7 @@ > > extern char name[32]; /* name of interface */ > extern int allmedia; >+extern int supmedia; > struct afswtch; > > extern void setmedia(const char *, int, int, const struct afswtch *rafp); >Index: ifmedia.c >=================================================================== >RCS file: /home/ncvs/src/sbin/ifconfig/ifmedia.c,v >retrieving revision 1.7 >diff -u -r1.7 ifmedia.c >--- ifmedia.c 2001/05/26 09:26:01 1.7 >+++ ifmedia.c 2001/05/28 05:42:09 >@@ -164,13 +164,13 @@ > > putchar('\n'); > >- if (ifmr.ifm_count > 0) { >- printf("\tsupported media:"); >+ if (ifmr.ifm_count > 0 && supmedia) { >+ printf("\tsupported media:\n"); > for (i = 0; i < ifmr.ifm_count; i++) { >- putchar(' '); >+ printf("\t\t"); > print_media_word(media_list[i]); >+ putchar('\n'); > } >- putchar('\n'); > } > > free(media_list);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 27701
: 14807