From: Oliver Hartkopp <socketcan@hartkopp.net>
To: John Ernberg <john.ernberg@actia.se>, Pavel Pisa <pisa@cmp.felk.cvut.cz>
Cc: "Marc Kleine-Budde" <mkl@pengutronix.de>,
"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>,
"Adam Engström" <adam.engstrom@actia.se>
Subject: Re: Raw CAN socket support in LXC?
Date: Tue, 12 May 2015 20:09:28 +0200 [thread overview]
Message-ID: <555241D8.6050503@hartkopp.net> (raw)
In-Reply-To: <5550A95B.1000605@actia.se>
On 05/11/2015 03:06 PM, John Ernberg wrote:
> I succeeded in forwarding the can interface into the container.
> When I tried to open a socket, and bind it to the interface to make a
> test for receiving frames I got an error saying "socket: Address family
> not supported by protocol".
> Looking around in LXC, and then the kernel, I discovered that the AF_CAN
> implementation does not support net_namespaces yet, and net_namespaces
> does not implement any handling for CAN, so we cannot open any kind of
> socket to actually read from the interface.
>
> Is there anything quick and dirty I could try to see if socket traffic
> can be forwarded into the container on a phys-forwarded CAN interface?
You can try to read CAN frames from the CAN netdev via AF_PACKET socket:
https://github.com/linux-can/can-tests/blob/master/tst-packet.c
Or use wireshark which has CAN support too.
> Or would a proper net_namespaces implementation for CAN be necessary?
When you use AF_PACKET you bypass the CAN network layer stuff.
Best regards,
Oliver
prev parent reply other threads:[~2015-05-12 18:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-08 8:12 Raw CAN socket support in LXC? John Ernberg
2015-05-08 8:28 ` Marc Kleine-Budde
2015-05-08 8:45 ` John Ernberg
2015-05-08 8:54 ` Marc Kleine-Budde
2015-05-08 11:17 ` John Ernberg
2015-05-08 11:54 ` Marc Kleine-Budde
2015-05-08 12:24 ` John Ernberg
2015-05-08 12:31 ` Marc Kleine-Budde
2015-05-08 12:40 ` John Ernberg
2015-05-11 11:45 ` Pavel Pisa
2015-05-11 13:06 ` John Ernberg
2015-05-12 18:09 ` Oliver Hartkopp [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=555241D8.6050503@hartkopp.net \
--to=socketcan@hartkopp.net \
--cc=adam.engstrom@actia.se \
--cc=john.ernberg@actia.se \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=pisa@cmp.felk.cvut.cz \
/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.