(media_status): Factor common code between IFM_ETHER and IFM_ATM cases.
(print_media_word, print_media_word_ifconfig): Remove unnecessary goto following test for null desc. PR: bin/102354 Submitted by: Ricardo Nabinger Sanchez <rnsanchez@gmail.com> MFC after: 1 week
This commit is contained in:
parent
fb7e6ed3e6
commit
68e160886a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=161536
@ -146,6 +146,7 @@ media_status(int s)
|
|||||||
printf("\tstatus: ");
|
printf("\tstatus: ");
|
||||||
switch (IFM_TYPE(ifmr.ifm_active)) {
|
switch (IFM_TYPE(ifmr.ifm_active)) {
|
||||||
case IFM_ETHER:
|
case IFM_ETHER:
|
||||||
|
case IFM_ATM:
|
||||||
if (ifmr.ifm_status & IFM_ACTIVE)
|
if (ifmr.ifm_status & IFM_ACTIVE)
|
||||||
printf("active");
|
printf("active");
|
||||||
else
|
else
|
||||||
@ -160,13 +161,6 @@ media_status(int s)
|
|||||||
printf("no ring");
|
printf("no ring");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IFM_ATM:
|
|
||||||
if (ifmr.ifm_status & IFM_ACTIVE)
|
|
||||||
printf("active");
|
|
||||||
else
|
|
||||||
printf("no carrier");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case IFM_IEEE80211:
|
case IFM_IEEE80211:
|
||||||
/* XXX: Different value for adhoc? */
|
/* XXX: Different value for adhoc? */
|
||||||
if (ifmr.ifm_status & IFM_ACTIVE)
|
if (ifmr.ifm_status & IFM_ACTIVE)
|
||||||
@ -692,14 +686,11 @@ print_media_word(int ifmw, int print_toptype)
|
|||||||
|
|
||||||
/* Find subtype. */
|
/* Find subtype. */
|
||||||
desc = get_subtype_desc(ifmw, ttos);
|
desc = get_subtype_desc(ifmw, ttos);
|
||||||
if (desc != NULL)
|
if (desc == NULL) {
|
||||||
goto got_subtype;
|
printf("<unknown subtype>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Falling to here means unknown subtype. */
|
|
||||||
printf("<unknown subtype>");
|
|
||||||
return;
|
|
||||||
|
|
||||||
got_subtype:
|
|
||||||
if (print_toptype)
|
if (print_toptype)
|
||||||
putchar(' ');
|
putchar(' ');
|
||||||
|
|
||||||
@ -750,14 +741,11 @@ print_media_word_ifconfig(int ifmw)
|
|||||||
|
|
||||||
/* Find subtype. */
|
/* Find subtype. */
|
||||||
desc = get_subtype_desc(ifmw, ttos);
|
desc = get_subtype_desc(ifmw, ttos);
|
||||||
if (desc != NULL)
|
if (desc == NULL) {
|
||||||
goto got_subtype;
|
printf("<unknown subtype>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Falling to here means unknown subtype. */
|
|
||||||
printf("<unknown subtype>");
|
|
||||||
return;
|
|
||||||
|
|
||||||
got_subtype:
|
|
||||||
printf("media %s", desc->ifmt_string);
|
printf("media %s", desc->ifmt_string);
|
||||||
|
|
||||||
desc = get_mode_desc(ifmw, ttos);
|
desc = get_mode_desc(ifmw, ttos);
|
||||||
|
Loading…
Reference in New Issue
Block a user