[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 03 Mar 2015 09:03:01 -0800
From: Philippe Troin <phil@...i.org>
To: Sriram Raghunathan <sriram.r@....com>
Cc: netdev@...r.kernel.org
Subject: Re: About Raw socket, vlan + ip header
On Tue, 2015-03-03 at 10:44 +0530, Sriram Raghunathan wrote:
> Writing a socket program where, I'm trying to construct a ether frame
> with vlan id and copying ip header there after. By using PF_PACKET
> family.
>
> But when I do a sendto, the ip header is stripped off from the
> packet. Could you please let me know how to go about?
man 7 packet
...
The socket_type is either SOCK_RAW for raw packets including the link
level header or SOCK_DGRAM for cooked packets with the link level
header removed. The link level header information is available in a
common format in a sockaddr_ll. protocol is the IEEE 802.3 protocol
...
Are you opening a SOCK_RAW or a SOCK_DGRAM PF_PACKET socket?
Phil.
--
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