OpenVZ Forum


Home » General » Support » problem with socketcan in a VE (problem accessing socketcan interfaces within a VE)
problem with socketcan in a VE [message #41375] Wed, 12 January 2011 15:35 Go to next message
sleepy is currently offline  sleepy
Messages: 3
Registered: January 2011
Junior Member
Hi,

I'm trying to use socketcan within a VE.
On the host it runs without problems.

Im running Proxmox 1.7 as host and Ubuntu 10.04 as VE

host# pveversion -v
pve-manager: 1.7-10 (pve-manager/1.7/5323)
running kernel: 2.6.32-4-pve
proxmox-ve-2.6.32: 1.7-30
pve-kernel-2.6.32-4-pve: 2.6.32-30
qemu-server: 1.1-28
pve-firmware: 1.0-10
libpve-storage-perl: 1.0-16
vncterm: 0.9-2
vzctl: 3.0.24-1pve4
vzdump: 1.2-10
vzprocps: 2.0.11-1dso2
vzquota: 3.0.11-1
pve-qemu-kvm: 0.13.0-3
ksm-control-daemon: 1.0-4


On the host I loaded the required modules and moved the network device to the VE

host# lsmod
Module                  Size  Used by
vcan                    1575  0
can_raw                 5287  0
can                    27914  1 can_raw
...


host# vzctl set 110 --netdev_add vcan0
WARNING: Settings were not saved and will be reset to original values at the next start (use --save flag)


I got the device in the VE and also the protocol:
VE:/proc/net# ifconfig vcan0
vcan0     Link encap:UNSPEC  Hardware Adresse 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          UP RUNNING NOARP  MTU:16  Metrik:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:0 Sendewarteschlangenlänge:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


VE:/proc/net/can# cat protocols 
protocol  size sockets  memory press maxhdr  slab module     cl co di ac io in de sh ss gs se re sp bi br ha uh gp em
DDP        664      0      -1   NI       0   no   appletalk   n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n
IPX        688      0      -1   NI       0   yes  ipx         n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n
ROSE      1160      0      -1   NI       0   no   rose        n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n
NETROM    1144      0      -1   NI       0   no   netrom      n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n
AX25       656      0      -1   NI       0   no   ax25        n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n
CAN_RAW    728      0      -1   NI       0   no   can_raw     n  n  n  n  n  y  n  n  n  n  n  n  n  n  n  n  n  n  n
PACKET     920      0      -1   NI       0   no   kernel      n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n
RAWv6     1032      0      -1   NI       0   yes  kernel      y  y  y  n  y  y  y  n  y  y  y  y  n  y  y  y  y  n  n
UDPLITEv6 1024      0      -1   NI       0   yes  kernel      y  y  y  n  y  y  y  n  y  y  y  y  n  n  y  y  y  y  n
UDPv6     1024      0      16   NI       0   yes  kernel      y  y  y  n  y  n  y  n  y  y  y  y  n  n  y  y  y  y  n
TCPv6     1856      4      56   no     304   yes  kernel      y  y  y  y  y  y  y  y  y  y  n  y  n  n  y  y  y  y  y
UNIX       784   1051      -1   NI       0   yes  kernel      n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n
UDP-Lite   856      0      -1   NI       0   yes  kernel      y  y  y  n  y  y  y  n  y  y  y  y  y  n  y  y  y  y  n
RAW        832      0      -1   NI       0   yes  kernel      y  y  y  n  y  y  y  n  y  y  y  y  n  y  y  y  y  n  n
UDP        856      4      16   NI       0   yes  kernel      y  y  y  n  y  n  y  n  y  y  y  y  y  n  y  y  y  y  n
TCP       1688     25      56   no     304   yes  kernel      y  y  y  y  y  y  y  y  y  y  n  y  n  n  y  y  y  y  y
NETLINK    784      9      -1   NI       0   no   kernel      n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n  n


When I try to open a socket (e.g. with candump) I get:
VE:~$ candump vcan0
socket: Address family not supported by protocol


Have I missed something or are there any restrictions using socketcan within a VE?

Any ideas?

Thanx in advance.

Re: problem with socketcan in a VE [message #41379 is a reply to message #41375] Wed, 12 January 2011 18:33 Go to previous messageGo to next message
curx
Messages: 739
Registered: February 2006
Location: NĂĽrnberg, Germany
Senior Member

Hi,

can you use the candump with strace, and post the relevant info to the list, maybe open a bug report at http://bugzilla.openvz.org.

Bye,
Thorsten
Re: problem with socketcan in a VE [message #41409 is a reply to message #41375] Mon, 17 January 2011 11:09 Go to previous messageGo to next message
sleepy is currently offline  sleepy
Messages: 3
Registered: January 2011
Junior Member
Thanks for your reply.

strace output:
VE:~# strace candump vcan0
execve("/usr/local/bin/candump", ["candump", "vcan0"], [/* 41 vars */]) = 0
brk(0)                                  = 0x8bc4000
uname({sys="Linux", node="tees-ubutsvm-010", ...}) = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7787000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=49466, ...}) = 0
mmap2(NULL, 49466, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb777a000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 m\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1335560, ...}) = 0
mmap2(NULL, 1345896, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7631000
mprotect(0xb7773000, 4096, PROT_NONE)   = 0
mmap2(0xb7774000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x142) = 0xb7774000
mmap2(0xb7777000, 10600, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7777000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7630000
set_thread_area({entry_number:-1 -> 12, base_addr:0xb76306c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0xb7774000, 8192, PROT_READ)   = 0
mprotect(0xb77a4000, 4096, PROT_READ)   = 0
munmap(0xb777a000, 49466)               = 0
rt_sigaction(SIGTERM, {0x8048b00, [TERM], SA_RESTORER|SA_RESTART, 0xb765b6a8}, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGHUP, {0x8048b00, [HUP], SA_RESTORER|SA_RESTART, 0xb765b6a8}, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGINT, {0x8048b00, [INT], SA_RESTORER|SA_RESTART, 0xb765b6a8}, {SIG_DFL, [], 0}, 8) = 0
socket(0x1d /* PF_??? */, SOCK_RAW, 1)  = -1 EAFNOSUPPORT (Address family not supported by protocol)
dup(2)                                  = 3
fcntl64(3, F_GETFL)                     = 0x8002 (flags O_RDWR|O_LARGEFILE)
brk(0)                                  = 0x8bc4000
brk(0x8be5000)                          = 0x8be5000
fstat64(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 8), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7786000
_llseek(3, 0, 0xbfbbb284, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
write(3, "socket: Address family not suppo"..., 49socket: Address family not supported by protocol
) = 49
close(3)                                = 0
munmap(0xb7786000, 4096)                = 0
exit_group(1)                           = ?
Re: problem with socketcan in a VE [message #41413 is a reply to message #41409] Mon, 17 January 2011 15:52 Go to previous message
sleepy is currently offline  sleepy
Messages: 3
Registered: January 2011
Junior Member
I created a bug report:

bugzilla.openvz.org/show_bug.cgi?id=1743

Quote:
--- Comment #1 from Pavel Emelyanov 2011-01-17 09:13:13 EST ---
We don't support the CAN protocol in CTs yet.

Previous Topic: Wrong used disk space
Next Topic: problem with starting VE
Goto Forum:
  


Current Time: Fri Nov 15 04:05:41 GMT 2024

Total time taken to generate the page: 0.03264 seconds