lxc-create fails on IPv6 address

Bug #1258304 reported by Tim Spriggs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Fix Released
Undecided
Stéphane Graber

Bug Description

root@cps3:~/lxc# cat horizon-cps3.net.conf
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br18
lxc.network.name = eth0
lxc.network.hwaddr = 00:16:3e:00:02:70
lxc.network.ipv6 = 2607:f088:0:12::39
lxc.network.mtu = 9000

root@cps3:~/lxc# lxc-create -n horizon-cps3 -f horizon-cps3.net.conf -t ubuntu -B none
lxc-create: Failed to create backing store type none

lxc-create: Error creating backing store type none for horizon-cps3
lxc-create: Error creating container horizon-cps3

root@cps3:~/lxc# lxc-create -n horizon-cps3 -f horizon-cps3.net.conf -t ubuntu
lxc-create: No such file or directory - invalid ipv6 address: 38.7.240.136
lxc-create: Error creating container horizon-cps3

The same template (different IP/mac) worked on raring.

root@cps3:~/lxc# dpkg -l lxc | awk '/lxc/ {print $3}'
1.0.0~alpha1-0ubuntu14

Changed in lxc (Ubuntu):
assignee: nobody → Stéphane Graber (stgraber)
Revision history for this message
Stéphane Graber (stgraber) wrote :

Can you start your container with "-l debug -o debug" and attach the debug file generated?

Revision history for this message
Tim Spriggs (tims-t) wrote :

Sure thing, by "start" I assume you mean "create" since there is nothing created yet. There are only three lines in the debug output, I'll just paste it here:

root@cps3:~/lxc# lxc-create -n horizon-cps3 -f horizon-cps3.net.conf -t ubuntu -l debug -o debug
lxc-create: No such file or directory - invalid ipv6 address: 38.7.240.136
lxc-create: Error creating container horizon-cps3

root@cps3:~/lxc# cat debug
     lxc-create 1386289012.783 WARN lxc_log - lxc_log_init called with log already initialized
     lxc-create 1386289012.784 ERROR lxc_confile - No such file or directory - invalid ipv6 address: 38.7.240.136
     lxc-create 1386289012.785 ERROR lxc_create - Error creating container horizon-cps3

Revision history for this message
Tim Spriggs (tims-t) wrote :

Not sure if this is clear to everyone else so as a hint (I haven't looked at the code for lxc) the "IPv6" address shown gives a pretty good indication that something is parsing an IPv6 address and then representing the first 32 bits as an IPv4 address.

The specified ip address is 2607:f088:...
which we then split up into bytes: 26 07 f0 88
and then represent as base 10:

root@cps3:~/lxc# printf "%d.%d.%d.%d\n" 0x26 0x07 0xf0 0x88
38.7.240.136

anything that looks like address=ip is probably suspect.

Revision history for this message
Stéphane Graber (stgraber) wrote :

Yeah, I figured as much but looking at the code there's nothing obviously wrong...

I even managed to get LXC to say:
lxc_container: Failed to parse config: lxc.network.ipv6 = 38.7.240.136

Which is supposed to be a verbatim copy of the line it just read from the file... so I'm not sure what's somehow altering that value but it's perplexing... I'm doing some test builds with added debugging now to try and track down what's going on.

Revision history for this message
Stéphane Graber (stgraber) wrote :

Fix pushed upstream (rather obvious once I started looking at the right place...).
https://github.com/lxc/lxc/commit/64994c030ccf3980a34bc93072155b2810b8f691

Changed in lxc (Ubuntu):
status: New → Fix Committed
Changed in lxc (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.