Fix bootparamd on 64 bit platforms - at least amd64 was broken due to the
code believing long == 64 bits and using it to store/compare IPv4 addresses. PR: bin/112163 Submitted by: Tyler Spivey <tspivey@pcdesk.net> Reviewed by: imp Approved by: imp (mentor)
This commit is contained in:
parent
28a071a256
commit
4a5f4f3ddd
@ -28,7 +28,7 @@ static const char rcsid[] =
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
extern int debug, dolog;
|
||||
extern unsigned long route_addr;
|
||||
extern in_addr_t route_addr;
|
||||
extern char *bootpfile;
|
||||
|
||||
#define MAXLEN 800
|
||||
@ -48,7 +48,7 @@ bootparamproc_whoami_1_svc(whoami, req)
|
||||
bp_whoami_arg *whoami;
|
||||
struct svc_req *req;
|
||||
{
|
||||
long haddr;
|
||||
in_addr_t haddr;
|
||||
static bp_whoami_res res;
|
||||
if (debug)
|
||||
fprintf(stderr,"whoami got question for %d.%d.%d.%d\n",
|
||||
@ -81,7 +81,7 @@ struct svc_req *req;
|
||||
|
||||
if ( res.router_address.address_type != IP_ADDR_TYPE ) {
|
||||
res.router_address.address_type = IP_ADDR_TYPE;
|
||||
bcopy( &route_addr, &res.router_address.bp_address_u.ip_addr, 4);
|
||||
bcopy( &route_addr, &res.router_address.bp_address_u.ip_addr, sizeof(in_addr_t));
|
||||
}
|
||||
if (debug) fprintf(stderr,
|
||||
"Returning %s %s %d.%d.%d.%d\n",
|
||||
|
@ -32,7 +32,7 @@ static const char rcsid[] =
|
||||
|
||||
int debug = 0;
|
||||
int dolog = 0;
|
||||
unsigned long route_addr = -1;
|
||||
in_addr_t route_addr = -1;
|
||||
struct sockaddr_in my_addr;
|
||||
char *bootpfile = "/etc/bootparams";
|
||||
|
||||
|
@ -79,7 +79,7 @@ char **argv;
|
||||
bp_getfile_res *getfile_res, stat_getfile_res;
|
||||
|
||||
|
||||
long the_inet_addr;
|
||||
in_addr_t the_inet_addr;
|
||||
CLIENT *clnt;
|
||||
enum clnt_stat clnt_stat;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user