Code review comment for lp:~cameronnemo/upstart/ipv6

Revision history for this message
James Hunt (jamesodhunt) wrote :

Hi Cameron,

Thanks for updating. I've found another issue though: if there are 2 jobs that specify 'start on socket', one for IPv4 the other for IPv6, the bridge will be unable to call bind(2) for each protocol version currently:

$ cat <<EOT | sudo tee /etc/init/test-socket-bridge-ipv4.confj
start on socket PROTO=inet PORT=80 ADDR=127.0.0.1
exec echo ipv4
EOT

$ cat <<EOT | sudo tee /etc/init/test-socket-bridge-ipv6.conf
start on socket PROTO=inet6 PORT=80 ADDR=::1
exec echo ipv6
EOT

$ sudo extra/upstart-socket-bridge --debug
job_add_socket: Found socket
upstart_job_added: Job got added /com/ubuntu/Upstart/jobs/test_2dsocket_2dbridge_2dipv6
job_add_socket: Found socket
upstart-socket-bridge: Failed to bind socket in /com/ubuntu/Upstart/jobs/test_2dsocket_2dbridge_2dipv4: Address already in use

I think we may need some IPV6_V6ONLY setsockopt(2) magic to resolve this?

review: Needs Fixing

« Back to merge proposal