dhcpcd: dhcpStart: socket: Invalid argument

dhcpcd: dhcpStart: socket: Invalid argument

Post by Larry Breye » Tue, 01 Jun 1999 04:00:00



This is from VA Research, fresh out of the box, running Redhat 5.2.
rpm says its running dhcpcd-1.3.16, so I downloaded the source and
compiled and linked it without errors, but get the same results.

Here is the call its complaining about ...

  dhcpSocket = socket(AF_PACKET,SOCK_PACKET,htons(ETH_P_ALL));

... Does anybody have any idea what the problem is?

thanks.
--
Larry Breyer

 
 
 

dhcpcd: dhcpStart: socket: Invalid argument

Post by Larry Breye » Wed, 02 Jun 1999 04:00:00


I am new to Linux (Sun background) and am trying to get a DHCP client
connection to RoadRunner.  I have a brand new system from VA Research
running RedHat 5.2.  No source code.

Using "rpm -q" I found the machine is running dhcpcd version 1.3.16.
I downloaded and compiled the source from metalab.unc.edu.  It compiles
and links without any warnings or errors.  The library call that is
failing, which is in client.c, looks like this ...

int dhcpStart()
{
  int o = 1;
  struct ifreq  ifr;
  memset(&ifr,0,sizeof(struct ifreq));
  memcpy(ifr.ifr_name,IfName,IfName_len);

  dhcpSocket = socket(AF_PACKET,SOCK_PACKET,htons(ETH_P_ALL));
  if ( dhcpSocket == -1 )
    {
      syslog(LOG_ERR,"dhcpStart: socket: %m\n");
      exit(1);
    }

Can anyone give me a clue as to how to troubleshoot this?
The Makefile has no references to any libraries, so I have
no idea how to verify the presence or version numbers of
the libraries dhcpcd depends upon.

Larry Breyer

 
 
 

dhcpcd: dhcpStart: socket: Invalid argument

Post by Dann Churc » Thu, 03 Jun 1999 04:00:00


Larry,

Just went through the same thing myself.  I have RH5.2 running and had set
up the DHCP client with the dhcpcd supplied (version 0.7, I believe).
Packet exchange with the DHCP server appeared to be correct, and the server
showed that it had indeed checked out the address, but the interface was
never updated with the ip/netmask.

In frustration, I downloaded the 1.3.16 version of dhcpcd, compiled and ran
it with the same results that you are seeing.  When I did a man on socket,
I saw that it did not support this Address Family (AF_PACKET).  I tried
changing the call to:

socket(AF_INET,SOCK_DGRAM,17)

to set up a standard UDP port but ended up getting wierder errors in later
parts of the code.

SO, what I realized is that this version of dhcpcd was written for a newer
version of the kernel (2.2.x) with updated libraries to handle the
AF_PACKET family.  So I took the plunge and compiled a new kernel (2.2.5,
same as RH 6.0), and now the dhcpcd works beautifully.

Why the older dhcpcd didn't work for me I never found out.  Maybe somebody
else has had some experience getting that to work.  But upgrading the
kernel and using the newer dhcpcd has worked great for me.

Hope that helps.  Good luck!

--Dann Church


> I am new to Linux (Sun background) and am trying to get a DHCP client
> connection to RoadRunner.  I have a brand new system from VA Research
> running RedHat 5.2.  No source code.

> Using "rpm -q" I found the machine is running dhcpcd version 1.3.16.
> I downloaded and compiled the source from metalab.unc.edu.  It compiles
> and links without any warnings or errors.  The library call that is
> failing, which is in client.c, looks like this ...

> int dhcpStart()
> {
>   int o = 1;
>   struct ifreq  ifr;
>   memset(&ifr,0,sizeof(struct ifreq));
>   memcpy(ifr.ifr_name,IfName,IfName_len);

>   dhcpSocket = socket(AF_PACKET,SOCK_PACKET,htons(ETH_P_ALL));
>   if ( dhcpSocket == -1 )
>     {
>       syslog(LOG_ERR,"dhcpStart: socket: %m\n");
>       exit(1);
>     }

> Can anyone give me a clue as to how to troubleshoot this?
> The Makefile has no references to any libraries, so I have
> no idea how to verify the presence or version numbers of
> the libraries dhcpcd depends upon.

> Larry Breyer

 
 
 

1. dhcpcd: dhcpStart: socket: Invalid argument

I am new to Linux (Sun background) and am trying to get a DHCP client
connection to RoadRunner.  I have a brand new system from VA Research
running RedHat 5.2.  No source code.

Using "rpm -q" I found the machine is running dhcpcd version 1.3.16.
I downloaded and compiled the source from metalab.unc.edu.  It compiles
and links without any warnings or errors.  The library call that is
failing, which is in client.c, looks like this ...

int dhcpStart()
{
  int o = 1;
  struct ifreq  ifr;
  memset(&ifr,0,sizeof(struct ifreq));
  memcpy(ifr.ifr_name,IfName,IfName_len);

  dhcpSocket = socket(AF_PACKET,SOCK_PACKET,htons(ETH_P_ALL));
  if ( dhcpSocket == -1 )
    {
      syslog(LOG_ERR,"dhcpStart: socket: %m\n");
      exit(1);
    }

Can anyone give me a clue as to how to troubleshoot this?
The Makefile has no references to any libraries, so I have
no idea how to verify the presence or version numbers of
the libraries dhcpcd depends upon.

Larry Breyer

2. Dial back using dip as slip server

3. HELP !: "Socket(): Invalid argument" error with 2.2.8

4. Reading is much more interesting than TV (1228/1708)

5. IFCONFIG gives socket: invalid argument

6. NCFTP question

7. Problem with TCPDUMP ( it says : "tcpdump: socket: Invalid argument" ??!!

8. Looking for a Graphics Package that runs under UNIX

9. ifconfig, route, and socket: invalid argument (need help)

10. socket: Invalid argument <-- What does this mean?

11. ipx_interface: socket: invalid argument

12. 1 * HRFlHCkDK-TCP socket: "accept" failed: Invalid argument

13. IPX configuration, socket: Invalid argument