From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32000 invoked by alias); 1 Oct 2007 23:55:09 -0000 Received: (qmail 31983 invoked by uid 22791); 1 Oct 2007 23:55:08 -0000 X-Spam-Check-By: sourceware.org Received: from web54003.mail.re2.yahoo.com (HELO web54003.mail.re2.yahoo.com) (206.190.36.227) by sourceware.org (qpsmtpd/0.31) with SMTP; Mon, 01 Oct 2007 23:55:06 +0000 Received: (qmail 74503 invoked by uid 60001); 1 Oct 2007 23:55:00 -0000 X-YMail-OSG: v6jyo50VM1m4wVhyPksQG2LDNvu2Pkbh71XbB0rwESUezmM8zeVGXywpjwg_LLhUgf2_14bSMZzEtwvMY5K0l.bR9S0kWTMwL0a4TpyA2RX7D553D5DYbBfv6xtNGQ-- Received: from [65.113.40.1] by web54003.mail.re2.yahoo.com via HTTP; Mon, 01 Oct 2007 16:55:00 PDT Date: Mon, 01 Oct 2007 23:55:00 -0000 From: Xun Yuan To: Alok Singh , ecos-discuss@sources.redhat.com In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <653491.74266.qm@web54003.mail.re2.yahoo.com> Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: RE: [ECOS] IP adress Get and Set (SIOCSIFADDR problem ? ) X-SW-Source: 2007-10/txt/msg00012.txt.bz2 Hi Alok, Thank you so much for the quick reply! Both SOCK_RAW and SOCK_DGRAM work. Maybe some other options work as well. I talked to people at work. I was told the difference with different options lies in that when you get ip address, you will not be able to as a non-super-user if it's set with SOCK_RAW, since only super user has SOCK_RAW permission. My other question is that: is there a way for the set IP address to survive power cycle with ioctl(SIOCSIFADDR)? I know for sure if the host's original IP address is dynamic. When you power off the computer and power it back on, the DHCP in config file (etc/sysconfig/network-scripts/ifcfg-eth0) is still there, the system starts to get IP address from DHCP server. Thanks very much in advance! pam --- Alok Singh wrote: > Yuan, > I believe you are right. I always use SOCK_RAW. > Are you seeing any problem with SOCK_RAW? For some > reasons, ecos > bootp/dhcp sever code uses SOCK_DGRAM while setting > IP address. > > -ALOK > > -----Original Message----- > From: ecos-discuss-owner@ecos.sourceware.org > [mailto:ecos-discuss-owner@ecos.sourceware.org] On > Behalf Of Xun Yuan > Sent: Sunday, September 30, 2007 3:05 AM > To: ecos-discuss@sources.redhat.com > Subject: [ECOS] IP adress Get and Set (SIOCSIFADDR > problem ? ) > > HI There, > > Would someone please tell me why the second > parameter > in GetIP and SetIP is SOCK_DGRAM in the below link? > Does it matter in case of getting/setting IP > addresses > of an interface? If it does not, any value would > do, > such as SOCK_RAW, SOCK_DSTREAM, right? > > Thanks very much in advance > pam > > > http://www.cygwin.com/ml/ecos-discuss/2004-01/msg00130.html > ____________________________________________________________________________________ Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss