FreeBSD Bugzilla – Attachment 231443 Details for
Bug 261572
ifconfig(8): extend formatting of MAC addresses to dotted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for ifconfig(8) adding the dotted format for MAC addresses
ifconfig-format-dotted.diff (text/plain), 1.33 KB, created by
Trond Endrestøl
on 2022-01-30 13:33:59 UTC
(
hide
)
Description:
Patch for ifconfig(8) adding the dotted format for MAC addresses
Filename:
MIME Type:
Creator:
Trond Endrestøl
Created:
2022-01-30 13:33:59 UTC
Size:
1.33 KB
patch
obsolete
>diff --git a/sbin/ifconfig/af_link.c b/sbin/ifconfig/af_link.c >index fb7a235b2f49..00940cd3296f 100644 >--- a/sbin/ifconfig/af_link.c >+++ b/sbin/ifconfig/af_link.c >@@ -78,6 +78,21 @@ link_status(int s __unused, const struct ifaddrs *ifa) > NULL) { > *format_char = '-'; > } >+ } else if (f_ether != NULL && strcmp(f_ether, "dotted") == 0) { >+ /* Indices 0 and 1 is kept as is. */ >+ ether_format[ 2] = ether_format[ 3]; >+ ether_format[ 3] = ether_format[ 4]; >+ ether_format[ 4] = '.'; >+ ether_format[ 5] = ether_format[ 6]; >+ ether_format[ 6] = ether_format[ 7]; >+ ether_format[ 7] = ether_format[ 9]; >+ ether_format[ 8] = ether_format[10]; >+ ether_format[ 9] = '.'; >+ ether_format[10] = ether_format[12]; >+ ether_format[11] = ether_format[13]; >+ ether_format[12] = ether_format[15]; >+ ether_format[13] = ether_format[16]; >+ ether_format[14] = '\0'; > } > printf("\tether %s\n", ether_format); > } else { >diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 >index 621e22452c59..db433a67337f 100644 >--- a/sbin/ifconfig/ifconfig.8 >+++ b/sbin/ifconfig/ifconfig.8 >@@ -238,6 +238,8 @@ Separate address segments with a colon > Separate address segments with a dash > .It Sy default > Display ethernet addresses in the default format, >+.It Sy dotted >+Separate address segments with a dot > .Sy colon > .El > .It Sy inet
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 261572
:
231443
|
242216