Date: Sat, 19 Jul 2008 19:39:50 -0700 (PDT) From: Kevin JR <ultkevjr@yahoo.com> To: freebsd-questions@freebsd.org Subject: Need help to compile netlogin client Message-ID: <937405.42462.qm@web46116.mail.sp1.yahoo.com>
next in thread | raw e-mail | index | archive | help
--0-1656032950-1216521590=:42462 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable It must login first with a client before surf into Internet for me. The cli= ent can be compiled well under linux, however, it failed under freebsd due = to the following code dealing with acquire ip/mac information: [CODE] static void getAddr(int sockfd, struct usrinfoSet *pui) { =A0=A0=A0 struct ifreq addr; =A0=A0=A0 memset(&addr, 0x0, sizeof addr); =A0=A0=A0 strcpy(addr.ifr_name, pui -> dev); =A0=A0=A0 if (ioctl(sockfd, SIOCGIFADDR, (char *)&addr) =3D=3D -1) { =A0=A0=A0 =A0=A0=A0 perror("ioctl"); =A0=A0=A0 =A0=A0=A0 exit(EXIT_FAILURE); =A0=A0=A0 } =A0=A0=A0 strcpy(pui -> ip, inet_ntoa(((struct sockaddr_in *)&addr.ifr_addr= ) -> sin_addr)); =A0=A0=A0 memset(&addr, 0, sizeof addr); =A0=A0=A0 strcpy(addr.ifr_name, (*pui).dev); =A0=A0=A0 if(ioctl(sockfd, SIOCGIFHWADDR, (char *)&addr) =3D=3D -1) { =A0=A0=A0 =A0=A0=A0 perror("ioctl"); =A0=A0=A0 =A0=A0=A0 exit(EXIT_FAILURE); =A0=A0=A0 } =A0=A0=A0 memcpy(pui -> mac, addr.ifr_hwaddr.sa_data, 0x6); } [/CODE] The full source and client are attached. Thanks in advance! =0A=0A=0A --0-1656032950-1216521590=:42462--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?937405.42462.qm>