Skip to content

Commit

Permalink
Fix bind_interface not working for the default listener.
Browse files Browse the repository at this point in the history
Closes #1533. Thanks to Markus Gothe.
  • Loading branch information
ralight committed Jan 30, 2020
1 parent e188a6b commit ed5db1b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog.txt
Expand Up @@ -9,6 +9,7 @@ Broker:
listening socket, by calling freeaddrinfo. Closes #1565.
- Fix config->user not being freed on exit. Closes #1564.
- Fix trailing whitespace not being trimmed on acl users. Closes #1539.
- Fix `bind_interface` not working for the default listener. Closes #1533.

Library:
- Set minimum keepalive argument to `mosquitto_connect*()` to be 5 seconds.
Expand Down
2 changes: 2 additions & 0 deletions src/conf.c
Expand Up @@ -446,6 +446,7 @@ int config__parse_args(struct mosquitto_db *db, struct mosquitto__config *config
}

if(config->listener_count == 0
|| config->default_listener.bind_interface
#ifdef WITH_TLS
|| config->default_listener.cafile
|| config->default_listener.capath
Expand Down Expand Up @@ -499,6 +500,7 @@ int config__parse_args(struct mosquitto_db *db, struct mosquitto__config *config
}else{
config->listeners[config->listener_count-1].mount_point = NULL;
}
config->listeners[config->listener_count-1].bind_interface = config->default_listener.bind_interface;
config->listeners[config->listener_count-1].max_connections = config->default_listener.max_connections;
config->listeners[config->listener_count-1].protocol = config->default_listener.protocol;
config->listeners[config->listener_count-1].socket_domain = config->default_listener.socket_domain;
Expand Down

0 comments on commit ed5db1b

Please sign in to comment.