On Wed, Jun 07, 2017 at 05:58:42PM +1000, David Gwynne wrote:
> >
> > why not just add your one option to the vlan section, which is what it's
> > relevant to, for now. if in the future you make it work in other areas,
> > we can see whether it warrants a shuffle.
>
> well, vnetid and parent replace the vlan and vlandev parameters.
>
> how about this as a start?
>
looks good. some comments inline.
> as an aside, should i fix vlan.4 so it uses capitals on the 802.1
> things consistently? capitals are preferred, right?
>
i'm not sure what is considered correct, but i think we generally do
uppercase these. it would be good if both pages were consistent, yes.
adding to that, vlan(4) consistently uppercases VLAN, so maybe your diff
should too?
> Index: ifconfig.8
> ===================================================================
> RCS file: /cvs/src/sbin/ifconfig/ifconfig.8,v
> retrieving revision 1.282
> diff -u -p -r1.282 ifconfig.8
> --- ifconfig.8 12 May 2017 15:11:02 -0000 1.282
> +++ ifconfig.8 7 Jun 2017 07:54:52 -0000
> @@ -1666,46 +1666,48 @@ device will try to establish a data conn
> .Bk -words
> .Nm ifconfig
> .Ar vlan-interface
> -.Op Cm vlan Ar vlan-tag
> -.Op Oo Fl Oc Ns Cm vlandev Ar parent-interface
> +.Oo Fl Oc Ns Cm vnetid Ar vlan-tag
> +.Oo Fl Oc Ns Cm parent Ar parent-interface
normally parent would go before vnetid.
> .Ek
> .nr nS 0
> .Pp
> -The following options are available for a
> +The following options are available for
> .Xr vlan 4
> -interface:
> +and
> +.Xr svlan 4
> +interfaces:
> .Bl -tag -width Ds
> -.It Cm vlan Ar vlan-tag
> -Set the vlan tag value
> -to
> +.It Cm vnetid Ar vlan-tag
> +Set the vlan tag value to
so that would be uppercase
> .Ar vlan-tag .
> -This value is a 12-bit number which is used to create an 802.1Q
> -vlan header for packets sent from the vlan interface.
> -This value cannot be changed once it is set for an interface.
> -.It Cm vlandev Ar parent-interface
> -Associate with interface
> +This value is a 12-bit number which is used in the 802.1Q or 802.1AD
> +headers in packets handled by
> +.Xr vlan 4
> +or
> +.Xr svlan 4
> +interfaces respectively.
> +Valid tag values are from 1 to 4095 inclusive.
> +.It Cm Fl vnetid
there's different ways to do it, but this page uses
.It Cm -vnetid
the way you've done it will cause a mandoc warning (that it's skipping Cm)
> +Clear the tag value.
> +Packets on a vlan interface without a tag set will use a value of
> +0 in their headers.
> +.It Cm parent Ar parent-interface
again, parent before vnetid
> +Associate the vlan interface with the interface
again uppercase
> .Ar parent-interface .
> -Packets transmitted through the vlan interface will be
> -diverted to the specified interface
> -.Ar parent-interface
> -with 802.1Q vlan tagging.
> -Packets with 802.1Q tagging received
> +Packets transmitted on
> +.Xr vlan 4
> +or
> +.Xr svlan 4
> +interfaces will be tagged with 802.1Q or 802.1AD headers respectively
> +and transmitted on the specified parent interface.
> +Packets with 802.1Q or 802.1AD tags received
> by the parent interface with the correct vlan tag will be diverted to
uppercase
> -the associated vlan pseudo-device.
> -The vlan interface is assigned a
> -copy of the parent interface's flags and the parent's Ethernet address.
> -If
> -.Cm vlandev
> -and
> -.Cm vlan
> -are not set at the same time, the vlan tag will be inferred from
> -the interface name, for instance
> -.Cm vlan5
> -will be assigned 802.1Q tag 5.
> -.It Cm -vlandev
> +the associated vlan interface.
uppercase
> +Unless a custom Ethernet address is assigned to the vlan interface,
again
> +it will inherit a copy of the parent interface's Ethernet address.
> +.It Cm Fl parent
.It Cm -parent
> Disassociate from the parent interface.
> -This breaks the link between the vlan interface and its parent,
> -clears its vlan tag, flags, and link address, and shuts the interface down.
> +This breaks the link between the vlan interface and its parent.
uppercase
> .El
> .Sh EXAMPLES
> Assign the
>
jmc