mosquitto icon indicating copy to clipboard operation
mosquitto copied to clipboard

Mosquitto client use Ethernet interface instead of loopback interface

Open hasaafi opened this issue 2 years ago • 5 comments

With the version 1.4.14 i found that when :

  • 1/ plugged ethernet ( between embedded device and pc ) no need for internet or any connectivity just plugged in the ethernet cable.

  • 2/ run mosquitto localy and in loopback :
    - mosquitto with the default config : mosquitto -c /etc/mosquitto/mosquitto.conf -v -d - mosquitto_sub -h localhost -t topic/message & - mosquitto_pub -h localhost -m "hello" -t topic/message -d

-3/ unplugged ethernet.

=> Result : messages are buffered only when the ethernet is plugged. if i unplugged the ethernet messages are not buffered As soon as I plugged in the ethernet again, the messages are sent all at once.

when i check the mosquitto log, I found that the client use the IP of ethernet interface .

I tested with 1.5.8 version the problem is not seen . because they use the right interface( loopback interface) . which commit that fix this issue ?

hasaafi avatar Mar 24 '23 14:03 hasaafi

any help ?

hasaafi avatar Mar 27 '23 07:03 hasaafi

again

hasaafi avatar Mar 28 '23 13:03 hasaafi

I don't know. If this is important to you, you could run git bisect to find the commit.

ralight avatar Apr 01 '23 09:04 ralight

the problem here that i use an old bsp : linux 3.10 so i can't test commits between this 2 version , mosquitto need dependencies so with the newest version i can't run it on my bsp. I think that fixed in lib/net_mosq.c when they try to fixing another problem , but i can't find the commit

hasaafi avatar Apr 03 '23 10:04 hasaafi

@hasaafi f this can't be reproduced on the latest release the issue should be closed. If so it needs much more details and to argue that there is a bug in mosquitto as opposed to a problem in your setup.

gdt avatar Oct 15 '24 13:10 gdt