New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv6 addresses do not work for bridging. #886

Closed
austin-rausch opened this Issue Jul 16, 2018 · 14 comments

Comments

Projects
None yet
4 participants
@austin-rausch

austin-rausch commented Jul 16, 2018

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?

@toast-uz

This comment has been minimized.

Show comment
Hide comment
@toast-uz

toast-uz Jul 19, 2018

Contributor

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/).

Contributor

toast-uz commented Jul 19, 2018

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/).

@austin-rausch austin-rausch changed the title from IPv6 bridging not supported to IPv6 addresses do not work for bridging. Jul 19, 2018

@austin-rausch austin-rausch changed the title from IPv6 addresses do not work for bridging. to IPv6 addresses does not work for bridging. Jul 19, 2018

@austin-rausch

This comment has been minimized.

Show comment
Hide comment
@austin-rausch

austin-rausch Jul 19, 2018

@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

austin-rausch commented Jul 19, 2018

@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

@karlp

This comment has been minimized.

Show comment
Hide comment
@karlp

karlp Jul 19, 2018

Contributor

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

Contributor

karlp commented Jul 19, 2018

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

@toast-uz

This comment has been minimized.

Show comment
Hide comment
@toast-uz

toast-uz Jul 19, 2018

Contributor

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.

Contributor

toast-uz commented Jul 19, 2018

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.

@toast-uz

This comment has been minimized.

Show comment
Hide comment
@toast-uz

toast-uz Jul 19, 2018

Contributor

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.

Contributor

toast-uz commented Jul 19, 2018

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.

@toast-uz

This comment has been minimized.

Show comment
Hide comment
@toast-uz

toast-uz Jul 20, 2018

Contributor

@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.

Contributor

toast-uz commented Jul 20, 2018

@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.

@austin-rausch

This comment has been minimized.

Show comment
Hide comment
@austin-rausch

austin-rausch Jul 23, 2018

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.

austin-rausch commented Jul 23, 2018

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.

@austin-rausch austin-rausch changed the title from IPv6 addresses does not work for bridging. to IPv6 addresses do not work for bridging. Jul 23, 2018

@toast-uz

This comment has been minimized.

Show comment
Hide comment
@toast-uz

toast-uz Jul 23, 2018

Contributor

@karlp could you show the evidence of a bug?

Contributor

toast-uz commented Jul 23, 2018

@karlp could you show the evidence of a bug?

@karlp

This comment has been minimized.

Show comment
Hide comment
@karlp

karlp Jul 24, 2018

Contributor

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.

Contributor

karlp commented Jul 24, 2018

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.

@toast-uz

This comment has been minimized.

Show comment
Hide comment
@toast-uz

toast-uz Jul 24, 2018

Contributor

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

Contributor

toast-uz commented Jul 24, 2018

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

@karlp

This comment has been minimized.

Show comment
Hide comment
@karlp

karlp Jul 25, 2018

Contributor

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

Contributor

karlp commented Jul 25, 2018

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

@toast-uz

This comment has been minimized.

Show comment
Hide comment
@toast-uz

toast-uz Jul 25, 2018

Contributor

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

Contributor

toast-uz commented Jul 25, 2018

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

@toast-uz

This comment has been minimized.

Show comment
Hide comment
@toast-uz

toast-uz Jul 31, 2018

Contributor

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.

Contributor

toast-uz commented Jul 31, 2018

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.

@ralight ralight added this to the 1.5.1 milestone Aug 2, 2018

ralight added a commit that referenced this issue Aug 2, 2018

Fix IPv6 addresses not being able to be used as bridge addresses.
Closes #886.

Signed-off-by: Roger A. Light <roger@atchoo.org>
@ralight

This comment has been minimized.

Show comment
Hide comment
@ralight

ralight Aug 2, 2018

Contributor

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?

Contributor

ralight commented Aug 2, 2018

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?

@ralight ralight closed this Aug 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment