Commit 4475af5d authored by Mike Hibler's avatar Mike Hibler
Browse files

Tweak to make sure master-server interface works on multihomed-client.

parent b0b994a8
...@@ -401,6 +401,7 @@ main(int argc, char **argv) ...@@ -401,6 +401,7 @@ main(int argc, char **argv)
ClientLogInit(); ClientLogInit();
#ifdef MASTER_SERVER #ifdef MASTER_SERVER
if (imageid) { if (imageid) {
struct in_addr pif;
GetReply reply; GetReply reply;
int method = askonly ? MS_METHOD_ANY : xfermethods; int method = askonly ? MS_METHOD_ANY : xfermethods;
int timo = 5; /* XXX */ int timo = 5; /* XXX */
...@@ -418,7 +419,7 @@ main(int argc, char **argv) ...@@ -418,7 +419,7 @@ main(int argc, char **argv)
if (!ClientNetFindServer(ntohl(serverip.s_addr), if (!ClientNetFindServer(ntohl(serverip.s_addr),
portnum, host, imageid, portnum, host, imageid,
method, askonly, timo, method, askonly, timo,
&reply, NULL)) &reply, &pif))
fatal("Could not get download info for '%s'", fatal("Could not get download info for '%s'",
imageid); imageid);
...@@ -442,6 +443,14 @@ main(int argc, char **argv) ...@@ -442,6 +443,14 @@ main(int argc, char **argv)
mcastaddr.s_addr = htonl(reply.addr); mcastaddr.s_addr = htonl(reply.addr);
portnum = reply.port; portnum = reply.port;
/*
* Unless the user explicitly specified the interface
* to use, default to the one on which we got a
* response from the server.
*/
if (mcastif.s_addr == 0)
mcastif = pif;
if (serverip.s_addr == mcastaddr.s_addr) if (serverip.s_addr == mcastaddr.s_addr)
log("%s: address: %s:%d", log("%s: address: %s:%d",
imageid, inet_ntoa(mcastaddr), portnum); imageid, inet_ntoa(mcastaddr), portnum);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment