carp shutdown in /etc/rc

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

carp shutdown in /etc/rc

Camiel Dobbelaar
With hundreds of (vlan) interfaces, a shutdown takes quite a while.

Fix below.

--
Cam


Index: rc
===================================================================
RCS file: /cvs/src/etc/rc,v
retrieving revision 1.348
diff -u -r1.348 rc
--- rc  14 Jan 2011 00:05:42 -0000      1.348
+++ rc  3 Feb 2011 15:59:25 -0000
@@ -167,7 +167,7 @@
                echo /etc/rc.shutdown complete.

                # bring carp interfaces down gracefully
-               ifconfig | while read a b; do
+               ifconfig carp | while read a b; do
                        case $a in
                        carp+([0-9]):) ifconfig ${a%:} down ;;
                        esac

Reply | Threaded
Open this post in threaded view
|

Re: carp shutdown in /etc/rc

Henning Brauer-5
* Camiel Dobbelaar <[hidden email]> [2011-02-04 13:21]:
> With hundreds of (vlan) interfaces, a shutdown takes quite a while.
> Fix below.

hmm. this relies on all carp interfaces being in the carp interface
group. while that is the default, it is not necessarily so.

--
Henning Brauer, [hidden email], [hidden email]
BS Web Services, http://bsws.de
Full-Service ISP - Secure Hosting, Mail and DNS Services
Dedicated Servers, Rootservers, Application Hosting

Reply | Threaded
Open this post in threaded view
|

Re: carp shutdown in /etc/rc

Camiel Dobbelaar
On 4-2-2011 13:32, Henning Brauer wrote:
> * Camiel Dobbelaar <[hidden email]> [2011-02-04 13:21]:
>> With hundreds of (vlan) interfaces, a shutdown takes quite a while.
>> Fix below.
>
> hmm. this relies on all carp interfaces being in the carp interface
> group. while that is the default, it is not necessarily so.

I didn't know that a groupname takes precendence, neither did the
manpage.  :-)

--
Cam
Index: ifconfig.8
===================================================================
RCS file: /cvs/src/sbin/ifconfig/ifconfig.8,v
retrieving revision 1.212
diff -u -r1.212 ifconfig.8
--- ifconfig.8 23 Dec 2010 08:54:59 -0000 1.212
+++ ifconfig.8 4 Feb 2011 13:32:21 -0000
@@ -97,11 +97,15 @@
 .Dq en0 .
 If no optional parameters are supplied, this string can instead be just
 .Dq name .
-In this case, all interfaces of that type will be displayed.
+If an interface group with that name exists, all interfaces in the group
+will be shown.
+Otherwise,
+.Dq name
+is treated as a type and all interfaces of that type will be displayed.
 For example,
-.Dq carp
+.Dq fxp
 will display the current configuration of all
-.Xr carp 4
+.Xr fxp 4
 interfaces.
 .It Ar address_family
 Specifies the address family

Reply | Threaded
Open this post in threaded view
|

Re: carp shutdown in /etc/rc

Stuart Henderson
On 2011/02/04 14:37, Camiel Dobbelaar wrote:

> On 4-2-2011 13:32, Henning Brauer wrote:
> > * Camiel Dobbelaar <[hidden email]> [2011-02-04 13:21]:
> >> With hundreds of (vlan) interfaces, a shutdown takes quite a while.
> >> Fix below.
> >
> > hmm. this relies on all carp interfaces being in the carp interface
> > group. while that is the default, it is not necessarily so.
>
> I didn't know that a groupname takes precendence, neither did the
> manpage.  :-)

> +If an interface group with that name exists, all interfaces in the group
> +will be shown.

seems it's more complicated than that - if you remove all interfaces
from group carp, 'ifconfig carp' lists nothing:

$ ifconfig |grep ^carp
carp1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
carp2: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
$ ifconfig carp                                              
$

but with another type, this doesn't apply:

$ sudo ifconfig bge0 group em
$ ifconfig em | egrep '(0: |groups:)'
bge0: flags=28843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,NOINET6> mtu 1500
        groups: em
$ sudo ifconfig bge0 -group em
$ ifconfig em | egrep '(0: |groups:)'
em0: flags=8b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
        groups: egress

Reply | Threaded
Open this post in threaded view
|

Re: carp shutdown in /etc/rc

Jason McIntyre
In reply to this post by Camiel Dobbelaar
On Fri, Feb 04, 2011 at 02:37:43PM +0100, Camiel Dobbelaar wrote:

> On 4-2-2011 13:32, Henning Brauer wrote:
> > * Camiel Dobbelaar <[hidden email]> [2011-02-04 13:21]:
> >> With hundreds of (vlan) interfaces, a shutdown takes quite a while.
> >> Fix below.
> >
> > hmm. this relies on all carp interfaces being in the carp interface
> > group. while that is the default, it is not necessarily so.
>
> I didn't know that a groupname takes precendence, neither did the
> manpage.  :-)
>
> --
> Cam
> Index: ifconfig.8
> ===================================================================
> RCS file: /cvs/src/sbin/ifconfig/ifconfig.8,v
> retrieving revision 1.212
> diff -u -r1.212 ifconfig.8
> --- ifconfig.8 23 Dec 2010 08:54:59 -0000 1.212
> +++ ifconfig.8 4 Feb 2011 13:32:21 -0000
> @@ -97,11 +97,15 @@
>  .Dq en0 .
>  If no optional parameters are supplied, this string can instead be just
>  .Dq name .
> -In this case, all interfaces of that type will be displayed.
> +If an interface group with that name exists, all interfaces in the group
> +will be shown.
> +Otherwise,
> +.Dq name
> +is treated as a type and all interfaces of that type will be displayed.
>  For example,
> -.Dq carp
> +.Dq fxp
>  will display the current configuration of all
> -.Xr carp 4
> +.Xr fxp 4
>  interfaces.
>  .It Ar address_family
>  Specifies the address family
>

is this a useful distinction (even a valid one)? it sounds confusing to
me.

can you have carp interfaces that are not part of the carp group?

that is, "ifconfig carp" will display all carp interfaces, or all
interfaces in the carp group. is that not two ways of saying the same
thing?

jmc

Reply | Threaded
Open this post in threaded view
|

Re: carp shutdown in /etc/rc

Camiel Dobbelaar
In reply to this post by Stuart Henderson
On 4-2-2011 15:06, Stuart Henderson wrote:

> On 2011/02/04 14:37, Camiel Dobbelaar wrote:
>> On 4-2-2011 13:32, Henning Brauer wrote:
>>> * Camiel Dobbelaar <[hidden email]> [2011-02-04 13:21]:
>>>> With hundreds of (vlan) interfaces, a shutdown takes quite a while.
>>>> Fix below.
>>>
>>> hmm. this relies on all carp interfaces being in the carp interface
>>> group. while that is the default, it is not necessarily so.
>>
>> I didn't know that a groupname takes precendence, neither did the
>> manpage.  :-)
>
>> +If an interface group with that name exists, all interfaces in the group
>> +will be shown.
>
> seems it's more complicated than that - if you remove all interfaces
> from group carp, 'ifconfig carp' lists nothing:
>
> $ ifconfig |grep ^carp
> carp1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
> carp2: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
> $ ifconfig carp                                              
> $
>
> but with another type, this doesn't apply:
>
> $ sudo ifconfig bge0 group em
> $ ifconfig em | egrep '(0: |groups:)'
> bge0: flags=28843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,NOINET6> mtu 1500
>         groups: em
> $ sudo ifconfig bge0 -group em
> $ ifconfig em | egrep '(0: |groups:)'
> em0: flags=8b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
>         groups: egress

It looks like group "carp" is never removed from the system, even if it
becomes empty.  That makes sense since some daemons use it as a default.

But the manpage diff is still correct, isn't it?

--
Cam

Reply | Threaded
Open this post in threaded view
|

Re: carp shutdown in /etc/rc

Stuart Henderson
In reply to this post by Jason McIntyre
On 2011/02/04 14:08, Jason McIntyre wrote:

> > +If an interface group with that name exists, all interfaces in the group
> > +will be shown.
> > +Otherwise,
> > +.Dq name
> > +is treated as a type and all interfaces of that type will be displayed.
>
> is this a useful distinction (even a valid one)? it sounds confusing to
> me.
>
> can you have carp interfaces that are not part of the carp group?
>
> that is, "ifconfig carp" will display all carp interfaces, or all
> interfaces in the carp group. is that not two ways of saying the same
> thing?

yes, e.g. ifconfig carp123 group foo -group carp
this is useful when you want a set of interfaces to failover as a group.

Reply | Threaded
Open this post in threaded view
|

Re: carp shutdown in /etc/rc

Henning Brauer-5
In reply to this post by Camiel Dobbelaar
* Camiel Dobbelaar <[hidden email]> [2011-02-04 15:30]:

> On 4-2-2011 15:06, Stuart Henderson wrote:
> > On 2011/02/04 14:37, Camiel Dobbelaar wrote:
> >> On 4-2-2011 13:32, Henning Brauer wrote:
> >>> * Camiel Dobbelaar <[hidden email]> [2011-02-04 13:21]:
> >>>> With hundreds of (vlan) interfaces, a shutdown takes quite a while.
> >>>> Fix below.
> >>>
> >>> hmm. this relies on all carp interfaces being in the carp interface
> >>> group. while that is the default, it is not necessarily so.
> >>
> >> I didn't know that a groupname takes precendence, neither did the
> >> manpage.  :-)
> >
> >> +If an interface group with that name exists, all interfaces in the group
> >> +will be shown.
> >
> > seems it's more complicated than that - if you remove all interfaces
> > from group carp, 'ifconfig carp' lists nothing:
> >
> > $ ifconfig |grep ^carp
> > carp1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
> > carp2: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
> > $ ifconfig carp                                              
> > $
> >
> > but with another type, this doesn't apply:
> >
> > $ sudo ifconfig bge0 group em
> > $ ifconfig em | egrep '(0: |groups:)'
> > bge0: flags=28843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,NOINET6> mtu 1500
> >         groups: em
> > $ sudo ifconfig bge0 -group em
> > $ ifconfig em | egrep '(0: |groups:)'
> > em0: flags=8b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
> >         groups: egress
>
> It looks like group "carp" is never removed from the system, even if it
> becomes empty.  That makes sense since some daemons use it as a default.

i don't think there is is special treatment for the carp group. but
memory is fuzzy. we might very well "forget" to clean up when a group
becomes empty.

> But the manpage diff is still correct, isn't it?

it's clear the manoage isn't right as-is, that's for sure ;)

--
Henning Brauer, [hidden email], [hidden email]
BS Web Services, http://bsws.de
Full-Service ISP - Secure Hosting, Mail and DNS Services
Dedicated Servers, Rootservers, Application Hosting

Reply | Threaded
Open this post in threaded view
|

Re: carp shutdown in /etc/rc

Henning Brauer-5
In reply to this post by Jason McIntyre
* Jason McIntyre <[hidden email]> [2011-02-04 15:17]:
> is this a useful distinction (even a valid one)? it sounds confusing to
> me.

yes: ifconfig carp0 -group carp

> can you have carp interfaces that are not part of the carp group?
>
> that is, "ifconfig carp" will display all carp interfaces, or all
> interfaces in the carp group. is that not two ways of saying the same
> thing?

no, because you can remove carp interfaces from the carp group.
for cloners interfaces are always added to a group with its basename.
cloner: everything that you can ifconfig create + destroy
carpX -> carp group
pppoeX -> pppoe group
and so on

--
Henning Brauer, [hidden email], [hidden email]
BS Web Services, http://bsws.de
Full-Service ISP - Secure Hosting, Mail and DNS Services
Dedicated Servers, Rootservers, Application Hosting

Reply | Threaded
Open this post in threaded view
|

Re: carp shutdown in /etc/rc

Tobias Weingartner-2
In reply to this post by Henning Brauer-5
On Friday, February 4, Henning Brauer wrote:
>
> i don't think there is is special treatment for the carp group. but
> memory is fuzzy. we might very well "forget" to clean up when a group
> becomes empty.

There is a bit of an inconsistency when it comes to
'ifconfig foo' style of the ifconfig command.  You
can do 'ifconfig groupname', and it will show all
interfaces in group "groupname".  You can also do
'ifconfig dev-prefix', which seems to show all the
interfaces with the particular device prefix.

For example, on my box, if I do 'ifconfig bge', it
will show me all bge* interfaces, even if none of
them are in a group called 'bge'.  So the shutdown
could be correct using 'ifconfig carp', if that
command would return all carp interfaces because
"carp" is the dev-prefix.  However, since we have
a "carp" group, it uses that instead...


--Toby.

Reply | Threaded
Open this post in threaded view
|

Re: carp shutdown in /etc/rc

Henning Brauer-5
* Tobias Weingartner <[hidden email]> [2011-02-04 20:19]:

> On Friday, February 4, Henning Brauer wrote:
> > i don't think there is is special treatment for the carp group. but
> > memory is fuzzy. we might very well "forget" to clean up when a group
> > becomes empty.
> There is a bit of an inconsistency when it comes to
> 'ifconfig foo' style of the ifconfig command.  You
> can do 'ifconfig groupname', and it will show all
> interfaces in group "groupname".  You can also do
> 'ifconfig dev-prefix', which seems to show all the
> interfaces with the particular device prefix.

the latter is really a backwards compat thing. that was already there
before i wrote ifgroups, kinda... it might be time to fling off these
restraints.

> For example, on my box, if I do 'ifconfig bge', it
> will show me all bge* interfaces, even if none of
> them are in a group called 'bge'.  So the shutdown
> could be correct using 'ifconfig carp', if that
> command would return all carp interfaces because
> "carp" is the dev-prefix.  However, since we have
> a "carp" group, it uses that instead...

yes, i dislike that.

we decided against an automatic group for non-cloners. i do remember
discussions about it, i think i had those initially. i can't really
remember the reasoning for dropping these, but i have to admit i see
little use in them. which probably was the reason.

--
Henning Brauer, [hidden email], [hidden email]
BS Web Services, http://bsws.de
Full-Service ISP - Secure Hosting, Mail and DNS Services
Dedicated Servers, Rootservers, Application Hosting

Reply | Threaded
Open this post in threaded view
|

Re: carp shutdown in /etc/rc

Ted Unangst-2
In reply to this post by Camiel Dobbelaar
On Fri, Feb 4, 2011 at 7:21 AM, Camiel Dobbelaar <[hidden email]> wrote:
> With hundreds of (vlan) interfaces, a shutdown takes quite a while.
>                # bring carp interfaces down gracefully
> -               ifconfig | while read a b; do
> +               ifconfig carp | while read a b; do

going back to the original issue, does "ifconfig | grep carp | while
read a b" make things faster?

Reply | Threaded
Open this post in threaded view
|

Re: carp shutdown in /etc/rc

Camiel Dobbelaar
On 5-2-2011 2:15, Ted Unangst wrote:
> On Fri, Feb 4, 2011 at 7:21 AM, Camiel Dobbelaar <[hidden email]> wrote:
>> With hundreds of (vlan) interfaces, a shutdown takes quite a while.
>>                # bring carp interfaces down gracefully
>> -               ifconfig | while read a b; do
>> +               ifconfig carp | while read a b; do
>
> going back to the original issue, does "ifconfig | grep carp | while
> read a b" make things faster?

No, it's ifconfig itself that takes long.

With 2000 vlan interfaces and 1 carp interface:
# time ifconfig | grep ^carp
carp80: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    1m11.29s real     0m12.07s user     0m59.03s system
# time ifconfig carp | grep ^carp
carp80: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    0m0.06s real     0m0.01s user     0m0.05s system

1000
# time ifconfig | grep ^carp
carp80: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    0m16.66s real     0m2.88s user     0m13.72s system
# time ifconfig carp | grep ^carp
carp80: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    0m0.03s real     0m0.00s user     0m0.02s system

500
# time ifconfig | grep ^carp
carp80: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    0m3.18s real     0m0.67s user     0m2.49s system
# time ifconfig carp | grep ^carp
carp80: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    0m0.02s real     0m0.00s user     0m0.01s system

200
# time ifconfig | grep ^carp
carp80: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    0m0.35s real     0m0.07s user     0m0.27s system
# time ifconfig carp | grep ^carp
carp80: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    0m0.01s real     0m0.00s user     0m0.00s system


It does not scale linearly, but the real world usage (200) is fine.  I
think we can drop the diff, since it turned out not to be so obvious and
clean...

--
Cam

Reply | Threaded
Open this post in threaded view
|

Re: carp shutdown in /etc/rc

Henning Brauer-5
* Camiel Dobbelaar <[hidden email]> [2011-02-05 10:12]:
> No, it's ifconfig itself that takes long.

as said privately, i'd be surprised if it isn't the gazillion ioctls
ifconfig does.

> It does not scale linearly, but the real world usage (200) is fine.  I
> think we can drop the diff, since it turned out not to be so obvious and
> clean...

now... we DO take down ALL interfaces on shutdown now. equivalent to
ifconfig down. that was the result of an interesting bug i ran into in
stockholm, i was rebooting a soekris over and over and every now and
then had weird panics. turned out that the dma engine of the NICs was
scribbling over my memory since we didn't stop them at shutdown.

so this code in rc isn't all that much needed any more - now it "just"
makes sure the carp ifs are taken down before the real ones. that is
still good to have. now i wonder wether we can do this kernel side
early enough before the other interfaces go so that there is
sufficient headroom for a hitless failover.

on the other side, fixing "ifconfig very slow with lots of interfaces"
deserves to be fixed anyway. looking at the code - either getifaddrs is
slow (which in turn wouldn't be ifconfig only), or the ioctls ifconfig
does in getinfo(). that's "just" 5 tho. wonder wether making one big
ioctl that returns everything those 5 would help - wouldn't win a beauty
price for sure. not that ifconfig would ever qualify.

--
Henning Brauer, [hidden email], [hidden email]
BS Web Services, http://bsws.de
Full-Service ISP - Secure Hosting, Mail and DNS Services
Dedicated Servers, Rootservers, Application Hosting

Reply | Threaded
Open this post in threaded view
|

Re: carp shutdown in /etc/rc

Camiel Dobbelaar
On 5-2-2011 11:02, Henning Brauer wrote:
> on the other side, fixing "ifconfig very slow with lots of interfaces"
> deserves to be fixed anyway. looking at the code - either getifaddrs is
> slow (which in turn wouldn't be ifconfig only), or the ioctls ifconfig
> does in getinfo(). that's "just" 5 tho. wonder wether making one big
> ioctl that returns everything those 5 would help - wouldn't win a beauty
> price for sure. not that ifconfig would ever qualify.

If ifconfig.c is instrumented with a little perl script:

# cat ioctl_debug.pl
#!/usr/bin/perl -pi.orig

if (m{ioctl\(\w+, (\w+),}) {
    my $sig = $1;
    s{ioctl\(}{printf("ioctl $sig\\n") != -1 && ioctl(};
}

and then build like this:
# perl ioctl_debug.pl ifconfig.c
# make
# make install

you can see this:

# ifconfig carp80
ioctl SIOCGIFFLAGS
ioctl SIOCGIFXFLAGS
ioctl SIOCGIFMETRIC
ioctl SIOCGIFMTU
ioctl SIOCGIFRDOMAIN
ioctl SIOCGIFFLAGS
ioctl SIOCGIFXFLAGS
ioctl SIOCGIFMETRIC
ioctl SIOCGIFMTU
ioctl SIOCGIFRDOMAIN
carp80: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:00:5e:00:01:50
ioctl SIOCGIFDESCR
ioctl SIOCGIFPRIORITY
        priority: 0
ioctl SIOCGETKALIVE
ioctl SIOCGETVLAN
ioctl SIOCGVH
        carp: BACKUP carpdev vlan80 vhid 80 advbase 1 advskew 0
ioctl SIOCGETPFSYNC
ioctl PPPOEGETPARMS
ioctl SIOCGIFTIMESLOT
ioctl SIOCGIFGENERIC
ioctl SIOCGTRUNKPORT
ioctl SIOCGTRUNK
ioctl SIOCGETPFLOW
ioctl SIOCGIFGROUP
ioctl SIOCGIFGROUP
        groups: carp
ioctl SIOCGIFMEDIA
        status: backup
ioctl SIOCGLIFPHYADDR
        inet6 fe80::200:5eff:fe00:150%carp80ioctl SIOCGIFNETMASK_IN6
 prefixlen 64ioctl SIOCGIFAFLAG_IN6
 scopeid 0x7ioctl SIOCGIFALIFETIME_IN6

        inet 10.10.80.1ioctl SIOCGIFNETMASK
 netmask 0xffffff00ioctl SIOCGIFBRDADDR
 broadcast 10.10.80.255

# ifconfig vlan
ioctl SIOCGIFGMEMB
ioctl SIOCGIFGMEMB
ioctl SIOCGIFFLAGS
ioctl SIOCGIFXFLAGS
ioctl SIOCGIFMETRIC
ioctl SIOCGIFMTU
ioctl SIOCGIFRDOMAIN
vlan80: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:d0:59:b6:f4:27
ioctl SIOCGIFDESCR
ioctl SIOCGIFPRIORITY
        priority: 0
ioctl SIOCGETKALIVE
ioctl SIOCGETVLAN
ioctl SIOCGETVLANPRIO
        vlan: 80 priority: 0 parent interface: fxp0
ioctl SIOCGVH
ioctl SIOCGETPFSYNC
ioctl PPPOEGETPARMS
ioctl SIOCGIFTIMESLOT
ioctl SIOCGIFGENERIC
ioctl SIOCGTRUNKPORT
ioctl SIOCGTRUNK
ioctl SIOCGETPFLOW
ioctl SIOCGIFGROUP
ioctl SIOCGIFGROUP
        groups: vlan
ioctl SIOCGIFMEDIA
        status: active
ioctl SIOCGLIFPHYADDR
        inet6 fe80::2d0:59ff:feb6:f427%vlan80ioctl SIOCGIFNETMASK_IN6
 prefixlen 64ioctl SIOCGIFAFLAG_IN6
 scopeid 0x6ioctl SIOCGIFALIFETIME_IN6

        inet 10.10.80.2ioctl SIOCGIFNETMASK
 netmask 0xffffff00ioctl SIOCGIFBRDADDR
 broadcast 10.10.80.255

# ifconfig fxp
ioctl SIOCGIFGMEMB
ioctl SIOCGIFFLAGS
ioctl SIOCGIFXFLAGS
ioctl SIOCGIFMETRIC
ioctl SIOCGIFMTU
ioctl SIOCGIFRDOMAIN
fxp0:
flags=8b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:d0:59:b6:f4:27
ioctl SIOCGIFDESCR
ioctl SIOCGIFPRIORITY
        priority: 0
ioctl SIOCGETKALIVE
ioctl SIOCGETVLAN
ioctl SIOCGVH
ioctl SIOCGETPFSYNC
ioctl PPPOEGETPARMS
ioctl SIOCGIFTIMESLOT
ioctl SIOCGIFGENERIC
ioctl SIOCGTRUNKPORT
ioctl SIOCGTRUNK
ioctl SIOCGETPFLOW
ioctl SIOCGIFGROUP
ioctl SIOCGIFGROUP
        groups: egress
ioctl SIOCGIFMEDIA
ioctl SIOCGIFMEDIA
        media: Ethernet autoselect (100baseTX full-duplex)
        status: active
ioctl SIOCG80211NWID
ioctl SIOCG80211NWKEY
ioctl SIOCG80211WPAPSK
ioctl SIOCG80211POWER
ioctl SIOCG80211CHANNEL
ioctl SIOCG80211BSSID
ioctl SIOCG80211TXPOWER
ioctl SIOCG80211WPAPARMS
ioctl SIOCGLIFPHYADDR
        inet6 fe80::2d0:59ff:feb6:f427%fxp0ioctl SIOCGIFNETMASK_IN6
 prefixlen 64ioctl SIOCGIFAFLAG_IN6
 scopeid 0x2ioctl SIOCGIFALIFETIME_IN6

        inet 192.168.28.129ioctl SIOCGIFNETMASK
 netmask 0xffffff00ioctl SIOCGIFBRDADDR
 broadcast 192.168.28.255

So yeah, it looks like ifconfig can be made a little smarter.