On Thu, Oct 15, 2020 at 6:42 AM Willem de Bruijn <willemdebruijn.ker...@gmail.com> wrote: > > On Wed, Oct 14, 2020 at 10:25 PM Xie He <xie.he.0...@gmail.com> wrote: > > > > Actually I think dev->type can be seen from user space. For example, > > when you type "ip link", it will display the link type for you. So I > > think it is useful to keep different dev->type labels without merging > > them even if they appear to have no difference. > > Ah, indeed. These constants are matched in iproute2 in lib/ll_types.c > to string representations. > > Good catch. Yes, then they have to stay as is.
So in this case it may be better to keep dev->type as ARHPHRD_IPGRE for GRE devices with or without header_ops. This way we can avoid the need to update iproute2. We can still consider changing GRE devices in collect_md mode from ARPHRD_NONE to ARHPHRD_IPGRE. The original author who changed it to ARPHRD_NONE might assume ARHPHRD_IPGRE is for GRE devices with header_ops, so he felt he needed to distinguish GRE devices without header_ops by dev->type. However, ARHPHRD_IPGRE is actually already used for GRE devices with header_ops AND without header_ops. So it doesn't hurt to use ARHPHRD_IPGRE for GRE devices in collect_md mode, too. This would also make iproute2 to correctly display GRE devices in collect_md mode as GRE devices.