From owner-freebsd-net Sat Jul 7 15: 6:31 2001 Delivered-To: freebsd-net@freebsd.org Received: from peace.mahoroba.org (peace.calm.imasy.or.jp [202.227.26.34]) by hub.freebsd.org (Postfix) with ESMTP id F056237B405; Sat, 7 Jul 2001 15:06:17 -0700 (PDT) (envelope-from ume@mahoroba.org) Received: from localhost (IDENT:Rat3b1V0t2eZLK06oKCv25PwfaRCMPEB5N7LLZ0epVmtfHOeEVnf94pLmF+9hRNK@localhost [::1]) (authenticated as ume with CRAM-MD5) by peace.mahoroba.org (8.11.4/8.11.4/peace) with ESMTP/inet6 id f67M6Df37361; Sun, 8 Jul 2001 07:06:14 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Sun, 08 Jul 2001 07:06:10 +0900 (JST) Message-Id: <20010708.070610.74741066.ume@mahoroba.org> To: hackers@freebsd.org, net@freebsd.org Subject: Fw: Fwd: (SIOCAIFADDR) Please help me! From: Hajimu UMEMOTO X-Mailer: Mew version 1.95b119 on Emacs 20.7 / Mule 4.0 =?iso-2022-jp?B?KBskQjJWMWMbKEIp?= X-PGP-Public-Key: http://www.imasy.org/~ume/publickey.asc X-PGP-Fingerprint: 6B 0C 53 FC 5D D0 37 91 05 D0 B3 EF 36 9B 6A BC X-URL: http://www.imasy.org/~ume/ X-Operating-System: FreeBSD 5.0-CURRENT Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Sun_Jul__8_07:06:10_2001_142)--" Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org ----Next_Part(Sun_Jul__8_07:06:10_2001_142)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Eduardo, your mail host (200.190.143.201) seems to have no PTR RR. ----Next_Part(Sun_Jul__8_07:06:10_2001_142)-- Content-Type: Message/Rfc822 Content-Transfer-Encoding: 7bit Content-Disposition: inline Return-Path: Received: (from uucp@localhost) by mail.mahoroba.org (8.11.4/8.11.4/chaos) with UUCP id f67LotZ10291 for ume@mahoroba.org; Sun, 8 Jul 2001 06:50:55 +0900 (JST) (envelope-from ebf@cwb.fnn.net) Received: from cwb.fnn.net ([200.190.143.201]) by light.imasy.or.jp (8.11.3+3.4W/8.11.3/light) with SMTP/inet id f67Lo2B17435 for ; Sun, 8 Jul 2001 06:50:05 +0900 (JST) (envelope-from ebf@cwb.fnn.net) Received: (qmail 78571 invoked by uid 85); 7 Jul 2001 21:56:36 -0000 Received: from ebf@cwb.fnn.net by aline.cwb.fnn.net with FutureMail-ViruScanner-Por_Eduardo_B._Fonseca-0.96 (uvscan: v4.1.40/v4145. . Clean. Processed in 0.290295 secs); 07 Jul 2001 21:56:36 -0000 Received: from unknown (HELO peugeot206.cwb.fnn.net) (200.190.143.160) by aline.cwb.fnn.net with SMTP; 7 Jul 2001 21:56:36 -0000 Content-Type: text/plain; charset="iso-8859-1" From: "Eduardo B. Fonseca" Organization: A&D Solucoes Ltda. To: Hajimu UMEMOTO Subject: Fwd: (SIOCAIFADDR) Please help me! Date: Sat, 7 Jul 2001 18:50:08 -0300 X-Mailer: KMail [version 1.2] Message-Id: <01070718500804.00297@peugeot206.cwb.fnn.net> X-MIME-Autoconverted: from quoted-printable to 8bit by mail.mahoroba.org id f67LotZ10291 Mime-Version: 1.0 (modified by Mew) Content-Transfer-Encoding: quoted-printable (modified by Mew) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mr. Umemoto, Sorry to bother you. I'm trying to send this e-mail to the mailing lis= t but = (although I'm subscribed) It just doesn't work. Could you please, relay= this = to the freebsd-net and freebsd-hackers list? I can receive any e-mails = to the = list but I can't send. = Thanks a lot! Eduardo. - ---------- Forwarded Message ---------- Subject: (SIOCAIFADDR) Please help me! Date: Sat, 7 Jul 2001 18:37:14 -0300 From: Eduardo B. Fonseca To: freebsd-hackers@freebsd.org, hackers@freebsd.org, = freebsd-net@freebsd.org, net@freebsd.org Hello guys, =A0=A0=A0=A0=A0=A0=A0=A0 Please... What's wrong with the code below? So= metimes it works, sometimes it doesn't. Yesterday, I've tested it and everything worked f= ine... Now, everytime I try to set the machine's IP address with this code, it= does not work... It sets a bogus IP, with a bogus netmask... I'm stumped... I can't find documentation anywhere. void Interface:: AddAddressOnInterface(int sockfd, string ip, string netmsk, string broa= daddr) { =A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 struct =A0=A0=A0=A0=A0=A0= =A0=A0 ifaliasreq =A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 request; =A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 bzero (&request, sizeof(= struct ifaliasreq)); =A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 strcpy(request.ifra_name= ,deviceName.c_str()); =A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 request.ifra_addr.sa_fam= ily=A0=A0=A0=A0 =3D AF_INET; =A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 inet_pton(AF_INET, ip.c_= str(), &((struct sockaddr_in *)&request.ifra_addr)->sin_addr); =A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 inet_pton(AF_INET, netms= k.c_str(), &((struct sockaddr_in *)&request.ifra_mask)->sin_addr); =A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 inet_pton(AF_INET, broad= addr.c_str(), &((struct sockaddr_in *)&request.ifra_broadaddr)->sin_addr); =A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 ioctl(sockfd,SIOCAIFADDR= ,&request); } Thanks for any help. Regards, Eduardo. - ------------------------------------------------------- - -- = Eduardo B. Fonseca Diretor Regional Curitiba FutureNet Telecomunica=E7=F5es e Inform=E1tica Ltda ebf@cwb.fnn.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7R4QQf9aI6FhScUkRAqj4AJ9R83iKO+qQlzPvEun7tIWxgc+ERgCgrOqG wK5nfbFrAKf2IHK+A93VLl4=3D =3DJEsw -----END PGP SIGNATURE----- ----Next_Part(Sun_Jul__8_07:06:10_2001_142)---- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message