Skip to content
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
Closed

IPv6 addresses do not work for bridging. #886

austin-rausch opened this issue Jul 16, 2018 · 14 comments
Labels
Component: mosquitto-broker Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. Type: Bug
Milestone

Comments

@austin-rausch
Copy link

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

@austin-rausch austin-rausch changed the title IPv6 bridging not supported IPv6 addresses do not work for bridging. Jul 19, 2018
@austin-rausch austin-rausch changed the title IPv6 addresses do not work for bridging. IPv6 addresses does not work for bridging. Jul 19, 2018
@austin-rausch
Copy link
Author

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

@toast-uz
Copy link
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.

@toast-uz
Copy link
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.

@austin-rausch
Copy link
Author

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 IPv6 addresses does not work for bridging. IPv6 addresses do not work for bridging. Jul 23, 2018
@toast-uz
Copy link
Contributor

@karlp could you show the evidence of a bug?

@karlp
Copy link
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
Copy link
Contributor

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

@karlp
Copy link
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
Copy link
Contributor

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

@toast-uz toast-uz added Status: Review Needed The issue has a PR attached to it which needs to be reviewed. Type: Bug and removed Status: Review Needed The issue has a PR attached to it which needs to be reviewed. labels Jul 25, 2018
@toast-uz
Copy link
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.

@ralight ralight added Component: mosquitto-broker Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. labels Aug 2, 2018
@ralight ralight added this to the 1.5.1 milestone Aug 2, 2018
ralight added a commit that referenced this issue Aug 2, 2018
Closes #886.

Signed-off-by: Roger A. Light <roger@atchoo.org>
@ralight
Copy link
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 as completed Aug 14, 2018
ralight added a commit that referenced this issue Nov 8, 2018
Closes #886.

Signed-off-by: Roger A. Light <roger@atchoo.org>
@lock lock bot locked as resolved and limited conversation to collaborators Aug 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: mosquitto-broker Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. Type: Bug
Projects
None yet
Development

No branches or pull requests

4 participants