All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Timo Teräs" <timo.teras@iki.fi>
To: krbmit siso <krbmit@gmail.com>
Cc: netdev@vger.kernel.org, ipsec-tools-users@lists.sourceforge.net,
	ipsec-tools-devel@lists.sourceforge.net,
	ikev2-devel@lists.sourceforge.net
Subject: Re: protect raw sockets
Date: Fri, 19 Aug 2011 08:49:45 +0300	[thread overview]
Message-ID: <4E4DF979.5030708@iki.fi> (raw)
In-Reply-To: <CABjs8yVOgKBrF2dMopzPmsfouWz5WHCAZCqjG3nY76CaqTFRLw@mail.gmail.com>

On 08/18/2011 06:01 PM, krbmit siso wrote:
> After adding the below code in net/ipv4/raw.c in function raw_send_hdrinc()
> I am able to see packet sent using RAW_SOCKET getting protected .
> 
> Please  let me know how can it be done better and provide it has a feature
> , so that others can also use it  if  packet sent using RAW_SOCKET
> needs to be protected.

Raw sockets are raw sockets. They are used to send out network traffic
that was captured earlier, or to generate test traffic. I don't think
it makes any sense to apply XFRM policies to them: it might break the
usage this API was intended for. The whole purpose of raw sockets is to
bypass kernel side extra handling.

To generate IPsec protected stuff use the normal APIs: regular UDP/TCP
sockets.

The same applies for sending/receiving IKE packets. You need regular UDP
socket with IPsec bypass policy.

What's your point in trying to use raw sockets? You should not need to
use them unless you are implementing a packet capturer or a network
traffic generator.

- Timo

  reply	other threads:[~2011-08-19  5:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-18  8:15 protect raw sockets Naveen B N (nbn)
2011-08-18  8:28 ` krbmit siso
2011-08-18 15:01   ` krbmit siso
2011-08-19  5:49     ` Timo Teräs [this message]
2011-08-19  6:43       ` krbmit siso

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=4E4DF979.5030708@iki.fi \
    --to=timo.teras@iki.fi \
    --cc=ikev2-devel@lists.sourceforge.net \
    --cc=ipsec-tools-devel@lists.sourceforge.net \
    --cc=ipsec-tools-users@lists.sourceforge.net \
    --cc=krbmit@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.