netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sriram Raghunathan <srirr@nsn-intra.net>
To: ext Philippe Troin <phil@fifi.org>,
	Sriram Raghunathan <sriram.r@nsn.com>
Cc: netdev@vger.kernel.org
Subject: Re: About Raw socket, vlan + ip header
Date: Wed, 04 Mar 2015 10:06:58 +0530	[thread overview]
Message-ID: <54F68BEA.8040605@nsn-intra.net> (raw)
In-Reply-To: <1425402181.25299.1.camel@niobium.home.fifi.org>

Hi Philippe,

Using SOCK_RAW.

Sriram
On Tuesday 03 March 2015 10:33 PM, ext Philippe Troin wrote:
> 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.
>

      reply	other threads:[~2015-03-04  4:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-03  5:14 About Raw socket, vlan + ip header Sriram Raghunathan
2015-03-03 17:03 ` Philippe Troin
2015-03-04  4:36   ` Sriram Raghunathan [this message]

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=54F68BEA.8040605@nsn-intra.net \
    --to=srirr@nsn-intra.net \
    --cc=netdev@vger.kernel.org \
    --cc=phil@fifi.org \
    --cc=sriram.r@nsn.com \
    /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).