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

common/pick_address.cc: Copy public_netw to cluster_netw if cluster empty #12929

Merged
merged 3 commits into from Jan 24, 2017

Conversation

wjwithagen
Copy link
Contributor

  • When public network is set, but cluster network is not, then
    the cluster-bindings would be on 0.0.0.0 which could be unexpeted.

In this commit we copy the public network into the cluster network
to make sure that the cluster backend is not bound on 0.0.0.0
Which could be consideren an insecure, or unexpected, action.

Signed-off-by: Willem Jan Withagen wjw@digiware.nl

@wjwithagen wjwithagen changed the title common/pick_address.cc: Copy public_netw to cluset_netw if cluster empty common/pick_address.cc: Copy public_netw to cluster_netw if cluster empty Jan 14, 2017
@wido
Copy link
Member

wido commented Jan 14, 2017

Looks good to me, but can't this be done in config_opts.h already?

Otherwise this change looks good to me.

@wjwithagen
Copy link
Contributor Author

Hi @wido ,

Not really...
But I think you mean to do it when ceph.conf is read.
There it would lead to rather awkward code to see if addresses are changed.

Furthermore it needs to be done at the latest point possible because the std values from config_opts.h can be changed at several point during its lifetime. And here is where the values are actually used. And this is where it is actually used to determine the public/cluster IPs.

lderr(cct) << "Public network was set, but cluster network was not set " << dendl;
lderr(cct) << " Using public network also for cluster network" << dendl;
cct->_conf->set_val("cluster_network", cct->_conf->public_network);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better if we do this without actually changing the cluster_network option. Just set up a local value and use that below instead...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liewegas
I think that could be done even simpler, and just pass public_network instead of cluster_network in that case.
I'll rewrite the patch.

@wjwithagen wjwithagen force-pushed the wip-wjw-empty-cluster_network branch 2 times, most recently from c6bdb85 to 5027328 Compare January 15, 2017 18:59
@liewegas
Copy link
Member

Can you add a short note to PendingReleaseNotes (in ceph.git root) noting the change in behavior so that it will get folded into the release notes?

@wjwithagen
Copy link
Contributor Author

@liewegas
Will do...

@yuriw
Copy link
Contributor

yuriw commented Jan 16, 2017

test this please

@wjwithagen
Copy link
Contributor Author

@liewegas
Something along these lines??

@@ -7,3 +7,12 @@
in old version would operate on different priority ranges
than new ones. Once upgraded, cluster will operate on
consistent values.

* When assigning a network to then public network and not to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/then/the/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise lgtm!

@wjwithagen
Copy link
Contributor Author

@liewegas
Ack

@wjwithagen
Copy link
Contributor Author

@liewegas
Not sure why I'm having a conflict on PendingReleaseNotes

@liewegas
Copy link
Member

It changed from another PR that merged.. just rebase

 - When public network is set, but cluster network is not, then
   the cluster-bindings would be on 0.0.0.0 which could be unexpeted.

 In this commit we copy the public network into the cluster network
 to make sure that the cluster backend is not bound on 0.0.0.0
 Which could be consideren an insecure, or unexpected, action.

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
…public_netw

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
@yuriw
Copy link
Contributor

yuriw commented Jan 23, 2017

test this please

@yuriw
Copy link
Contributor

yuriw commented Jan 23, 2017

@wjwithagen this is redy for merge, sign off needed pls

@liewegas FYI

@liewegas liewegas merged commit 7eddf91 into ceph:master Jan 24, 2017
@wjwithagen wjwithagen deleted the wip-wjw-empty-cluster_network branch January 24, 2017 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants