[ECOS] IP adress Get and Set (SIOCSIFADDR problem ? )
Xun Yuan
xunyuan@yahoo.com
Mon Oct 1 23:55:00 GMT 2007
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 <alok.singh@broadcom.com> 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
More information about the Ecos-discuss
mailing list