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>] [day] [month] [year] [list]
Date:	Tue, 18 Jan 2011 10:04:40 +0100
From:	"Marjan Schiller" <lxdmail@....de>
To:	netdev@...r.kernel.org
Subject: dev_queue_xmit and sockets

Hi!

I am currently developing a netfilter module which passes incoming and outgoing ethernet packages from one interface to an another interface ( a tun device ). This works very well, the tcpdump shows correct packages on the destination device and PING and ARP works good.

But i get into trouble if i want to create a socket connection with these packages. It seams to me that the packages are only "useable" within the kernel space and not the user space. Did i miss something there? Do i have to prepare the SKB for user mode or something like that?

I can establish a connection between the client socket and the server socket, but the server socket does not read any data ( But the packet with the data has reached the interface ).

Here is an example how i pass the packaged to the tun device:

static unsigned int send_ethernet_package( struct sk_buff * in_skb, void * data, int len, struct net_device * dev )
{
  struct sk_buff *skb;

  skb = alloc_skb( len , GFP_ATOMIC);
  skb_put( skb, len );
  skb->pkt_type = PACKET_HOST;
  skb->dev = dev;
  memcpy(skb->head, data , len );
  dev_queue_xmit( skb );

  return 0;
}

The data parameter is a well formed ethernet package.

Someone how has a guess whats wrong with this?

Thanks for help
    
    Marjan

-- 
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail
--
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