From: "Marjan Schiller" <lxdmail@gmx.de>
To: netdev@vger.kernel.org
Subject: dev_queue_xmit and sockets
Date: Tue, 18 Jan 2011 10:04:40 +0100 [thread overview]
Message-ID: <20110118090440.266580@gmx.net> (raw)
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
reply other threads:[~2011-01-18 9:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110118090440.266580@gmx.net \
--to=lxdmail@gmx.de \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).