Date: Fri, 20 Sep 2002 23:12:05 +0200 From: Thomas Moestl <tmoestl@gmx.net> To: freebsd-sparc@freebsd.org Subject: Fix for dhclient problems Message-ID: <20020920211205.GA16973@crow.dom2ip.de>
next in thread | raw e-mail | index | archive | help
Hi, I've attached a patch that should fix the problems with dhclient that people were seeing. I'll try to get this committed soon. - Thomas -- Thomas Moestl <tmoestl@gmx.net> http://www.tu-bs.de/~y0015675/ <tmm@FreeBSD.org> http://people.FreeBSD.org/~tmm/ PGP fingerprint: 1C97 A604 2BD0 E492 51D0 9C0F 1FE6 4F1D 419C 776C Index: common/bpf.c =================================================================== RCS file: /home/ncvs/src/contrib/isc-dhcp/common/bpf.c,v retrieving revision 1.1.1.6 diff -u -r1.1.1.6 bpf.c --- common/bpf.c 19 Feb 2002 11:04:33 -0000 1.1.1.6 +++ common/bpf.c 20 Sep 2002 21:10:03 -0000 @@ -241,6 +241,7 @@ u_int32_t addr; struct bpf_program p; u_int32_t bits; + u_int rbuf_max; #ifdef DEC_FDDI int link_layer; #endif /* DEC_FDDI */ @@ -278,8 +279,9 @@ log_fatal ("Can't set ENBATCH|ENCOPYALL|ENBPFHDR: %m"); #endif /* Get the required BPF buffer length from the kernel. */ - if (ioctl (info -> rfdesc, BIOCGBLEN, &info -> rbuf_max) < 0) + if (ioctl (info -> rfdesc, BIOCGBLEN, &rbuf_max) < 0) log_fatal ("Can't get bpf buffer length: %m"); + info -> rbuf_max = rbuf_max; info -> rbuf = dmalloc (info -> rbuf_max, MDL); if (!info -> rbuf) log_fatal ("Can't allocate %ld bytes for bpf input buffer.", Index: common/convert.c =================================================================== RCS file: /home/ncvs/src/contrib/isc-dhcp/common/convert.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 convert.c --- common/convert.c 10 Feb 1999 09:10:13 -0000 1.1.1.1 +++ common/convert.c 20 Sep 2002 21:10:03 -0000 @@ -51,7 +51,7 @@ u_int32_t getULong (buf) unsigned char *buf; { - unsigned long ibuf; + u_int32_t ibuf; memcpy (&ibuf, buf, sizeof (u_int32_t)); return ntohl (ibuf); @@ -60,7 +60,7 @@ int32_t getLong (buf) unsigned char *buf; { - long ibuf; + int32_t ibuf; memcpy (&ibuf, buf, sizeof (int32_t)); return ntohl (ibuf); @@ -69,7 +69,7 @@ u_int16_t getUShort (buf) unsigned char *buf; { - unsigned short ibuf; + u_int16_t ibuf; memcpy (&ibuf, buf, sizeof (u_int16_t)); return ntohs (ibuf); @@ -78,7 +78,7 @@ int16_t getShort (buf) unsigned char *buf; { - short ibuf; + int16_t ibuf; memcpy (&ibuf, buf, sizeof (int16_t)); return ntohs (ibuf); Index: omapip/convert.c =================================================================== RCS file: /home/ncvs/src/contrib/isc-dhcp/omapip/convert.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 convert.c --- omapip/convert.c 19 Feb 2002 11:04:32 -0000 1.1.1.1 +++ omapip/convert.c 20 Sep 2002 21:10:03 -0000 @@ -52,7 +52,7 @@ u_int32_t getULong (buf) const unsigned char *buf; { - unsigned long ibuf; + u_int32_t ibuf; memcpy (&ibuf, buf, sizeof (u_int32_t)); return ntohl (ibuf); @@ -61,7 +61,7 @@ int32_t getLong (buf) const unsigned char *buf; { - long ibuf; + int32_t ibuf; memcpy (&ibuf, buf, sizeof (int32_t)); return ntohl (ibuf); @@ -70,7 +70,7 @@ u_int32_t getUShort (buf) const unsigned char *buf; { - unsigned short ibuf; + u_int16_t ibuf; memcpy (&ibuf, buf, sizeof (u_int16_t)); return ntohs (ibuf); @@ -79,7 +79,7 @@ int32_t getShort (buf) const unsigned char *buf; { - short ibuf; + int16_t ibuf; memcpy (&ibuf, buf, sizeof (int16_t)); return ntohs (ibuf); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020920211205.GA16973>
