diff options
author | rink <rink@FreeBSD.org> | 2008-01-30 13:48:37 +0000 |
---|---|---|
committer | rink <rink@FreeBSD.org> | 2008-01-30 13:48:37 +0000 |
commit | 43c3361485263c7f1fda0c7fc3639fee6b53bbf0 (patch) | |
tree | f0932b840e59478b895c3d78f153298730616e0d /usr.sbin/bootparamd | |
parent | 100288925824644ec34f1edf0c814f9fa69c20e8 (diff) | |
download | FreeBSD-src-43c3361485263c7f1fda0c7fc3639fee6b53bbf0.zip FreeBSD-src-43c3361485263c7f1fda0c7fc3639fee6b53bbf0.tar.gz |
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)
MFC after: 1 week
Diffstat (limited to 'usr.sbin/bootparamd')
-rw-r--r-- | usr.sbin/bootparamd/bootparamd/bootparamd.c | 6 | ||||
-rw-r--r-- | usr.sbin/bootparamd/bootparamd/main.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/bootparamd/bootparamd/bootparamd.c b/usr.sbin/bootparamd/bootparamd/bootparamd.c index 205b6c7..c638730 100644 --- a/usr.sbin/bootparamd/bootparamd/bootparamd.c +++ b/usr.sbin/bootparamd/bootparamd/bootparamd.c @@ -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", diff --git a/usr.sbin/bootparamd/bootparamd/main.c b/usr.sbin/bootparamd/bootparamd/main.c index edd78ed..87b8f96 100644 --- a/usr.sbin/bootparamd/bootparamd/main.c +++ b/usr.sbin/bootparamd/bootparamd/main.c @@ -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"; |