lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 24 Feb 2010 22:52:27 +1100
From:	andrew hendry <andrew.hendry@...il.com>
To:	netdev@...r.kernel.org, linux-kernel <linux-kernel@...r.kernel.org>
Subject: tuntap with tun_no_pi and X25 question

Setting up tun using X25, I can read X25 from the tun but cannot write
to it, hitting this -EINVAL on write.

/* Get packet from user space buffer */
static __inline__ ssize_t tun_get_user(struct tun_struct *tun,
                                       const struct iovec *iv, size_t count,
                                       int noblock)
{

....
       case TUN_TUN_DEV:
                if (tun->flags & TUN_NO_PI) {
                        switch (skb->data[0] & 0xf0) {
                        case 0x40:
                                pi.proto = htons(ETH_P_IP);
                                break;
                        case 0x60:
                                pi.proto = htons(ETH_P_IPV6);
                                break;
                        default:
                                tun->dev->stats.rx_dropped++;
                                kfree_skb(skb);
                                return -EINVAL;
                        }
                }
....

The 0x40 and 0x60 comes from the first byte of the IP which has the
version there?
With X.25 the first byte changes depending on the call sequence, so it
cant be detected and set in the same way.

Is there a way to for a combination of TUNSETIFF with IFF_TUN |
IFF_NO_PI and TUNSETLINK with ARPHRD_X25 to work?
Probably all the non IP type protocols in if_arp.h have the same issue
with IFF_NO_PI?

thanks,
Andrew
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ