lkml.org 
[lkml]   [2018]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] net: arp, ipv6: handle special case of tap device
From
From: Vladis Dronov <vdronov@redhat.com>
Date: Wed, 26 Sep 2018 11:30:18 +0200

> @@ -187,7 +187,14 @@ EXPORT_SYMBOL(arp_tbl);
>
> int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir)
> {
> - switch (dev->type) {
> + unsigned short type = dev->type;
> +
> +#if IS_ENABLED(CONFIG_TAP)
> + if (dev->rtnl_link_ops && !strcmp(dev->rtnl_link_ops->kind, "tun"))
> + type = ARPHRD_ETHER;
> +#endif /* CONFIG_TAP */

This is insanely ugly.

dev->type determines the link layer header layout and size.

You can fix the kernel, but userspace AF_PACKET applications are still
going to be broken by this behavior. And that is just the tip of the
iceberg.

I'm not applying this, sorry. I think tun/tap should be prevented from
allowing the dev->type to be changed, unless it will make those changes
adjust the link layer headers properly as well.

Sorry.

\
 
 \ /
  Last update: 2018-09-29 20:41    [W:0.061 / U:23.828 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site