Mosquitto: IPv6 addresses do not work for bridging.

Created on 16 Jul 2018  路  14Comments  路  Source: eclipse/mosquitto

Using IPv6 addresses for bridging brokers currently does not work with Mosquitto. This doesn't appear in the documentation anywhere either.

In the meantime, if this requires a lot of code changes a documentation update to specify that only IPv4 sockets are supported for bridges at this time should be made.

A couple things will need changed to make IPv6 addresses work:

  1. The conf file doesn't parse the address correctly, as it finds the first : token and splits on that token for <address>:<port>, this doesn't work for IPv6 addresses because they have : as their delimiter. This should be changed to look from the end instead of the beginning. Link
  2. It doesn't look the the bridging code supports IPv6 sockets in its connect logic, as the bridge struct doesn't have anything indicating address type. Link

Thoughts? Concerns?

bug mosquitto-broker pending-close

All 14 comments

Please change the subject If you insist on reporting a bug. This place is not for a question nor for a new feature's request. Look at the instruction (https://mosquitto.org/).

@toast-uz Please look at the bridge section of the mosquitto.conf documentation, you'll see that it does not specify that the address has to be IPv4, it simply says address and port. This means one of two things, this is a bug and it was intended to be supported with both IPv6 and IPv4 addresses, or this is intentional behavior as IPv4 addresses were the only ones intended to be supported for bridges. I'm not sure what you mean mean by changing the subject to clarify this is a bug, as there is not official guide line or structure for issue reporting. The nature of this ticket is ambiguous as the documentation is ambiguous. I changed the title to hopefully be a little clearer as to what I am reporting in this issue.

Link: https://mosquitto.org/man/mosquitto-conf-5.html

@toast-uz this is definitely a bug, not a feature request. You need to read the bugs a little more sometimes.

https://mosquitto.org/ show you:

  • Report bugs or submit changes on the Github repository

I guess reporting bugs are at this issue list, and submitting changes are at PRs.

Essentially, the issue list is for the users search known bugs. But I guess mosquitto's community is too flexible to realize the original purpose. There are over 200 issues! Therefore, I am asking the not a bug reporters to close the issue and post at mosquitto-dev ML.

If your real insist is reporting a critical bug on the document, keep your issue. If not, your real insist is a new request for supporting IPv6 bridge, I am asking to close this issue and post at mosquitto-dev ML.

Sorry for your inconvenience.

@karlp sorry l read your comment right now. Just I'd like to clarify @austin-rausch 's intent before my investigation. I've not add any label on this issue yet.
Anyway, if you are sure it is a bug, it should be treated as a bug.

Close this and handle it how you want. Bug report for IPv6 not being supported on mosquitto bridging / not in documentation. Or a feature request for IPv6 bridging, I don't care. You have the information do whatever you want with it.

@karlp could you show the evidence of a bug?

seriously? let me reword the original (valid) bug report

First, let's set up a v6 only broker, happily listening via a v6 address in the bind_address or listener directives....

karlp@beros:~/src/mosquitto (master)$ cat v6-via-listener.conf 
#bind_address ::1
#port 9000
listener 9000 ::1
log_type debug
$ src/mosquitto -v -c v6-via-listener.conf 
1532466073: mosquitto version 1.5 starting
1532466073: Config loaded from v6-via-listener.conf.
1532466073: Opening ipv6 listen socket on port 9000.

Now, let's make a bridge connection to that _via the ipv6 name "localhost6"_

karlp@beros:~/src/mosquitto (master)$ cat v6-bridge.conf 
bind_address ::1
port 9001
log_type debug

# v6 bridge via address won't work..., even without the port
connection v6joys
#address ::1   # this doesn't work at all.... and is what this bug is for <<<<<
address localhost6:9000   # this will work...
cleansession true
topic karlos out 1
karlp@beros:~/src/mosquitto (master)$ src/mosquitto -v -c v6-bridge.conf 
1532466106: mosquitto version 1.5 starting
1532466106: Config loaded from v6-bridge.conf.
1532466106: Opening ipv6 listen socket on port 9001.
1532466106: Bridge local.beros.v6joys doing local SUBSCRIBE on topic karlos
1532466106: Connecting bridge v6joys (localhost6:9000)
1532466106: Bridge beros.v6joys sending CONNECT
1532466106: Received CONNACK on connection local.beros.v6joys.
1532466106: Bridge local.beros.v6joys sending UNSUBSCRIBE (Mid: 2, Topic: karlos)
1532466106: Received PUBACK from local.beros.v6joys (Mid: 1)
1532466106: Received UNSUBACK from local.beros.v6joys

See how it accepts v6 addresses and v6 resolutions of names everywhere _except_ the "address" directive to a bridge? That's what this bug is for. I don't believe that could be considered anything other than a bug.

There is a possibility originally no intention to support v6 bridge, but just happened to run in the case of the name resolution?

really? so v6 should be supported for listening, but not connecting? that would be horrifically inconsistent and simply an even bigger bug.

Sorry, I didn't say should, nor clarified into one side. There are both possibilities. The truth is behind @ralight 's intent.

I've changed the label as a bug, because I found the intent of implementation of IPv6 bridge on ver 1.4.11 in ChangeLog.txt.

I've just pushed a change that fixes this. Are you able to test the fixes branch, and close the issue if you're happy?

Was this page helpful?
0 / 5 - 0 ratings