# Error, dhcpConfig: ioctl SIOCADDRT: File exists [SOLVED]

## HeXiLeD

currently having a problem with dhcpcd.

Around a year ago when i instaled gentoo i also instaled 2 network packages:

```

*  app-misc/livecd-tools

      Latest version available: 1.0.29

      Latest version installed: 1.0.29

      Size of downloaded files: 24 kB

      Homepage:    http://www.gentoo.org

      Description: Gentoo LiveCD tools for autoconfiguration of hardware

      License:     GPL-2

*  net-misc/dhcpcd

      Latest version available: 2.0.5

      Latest version installed: 2.0.5

      Size of downloaded files: 365 kB

      Homepage:    http://developer.berlios.de/projects/dhcpcd/

      Description: A DHCP client only

      License:     GPL-2

```

Until to the update of dhcpcd to version 2.0.5 i never had problems.

I have always used the livecd-tools to pull up  the command net-setup eth* to setup my manual network settings.

The script allows us to specify if we want to use dhcpcd or not and setup the ip/gateway and the rest .

If we pick the option  to use dhcpcd then dhcpcd will override and re-write any settings in /etc/conf.d/net; or if we decide to specify the manual network setup then net-setup  will re-write /etc/conf.d/net.

After all of this all we have to do is restart  the network " /etc/init.d/net.eth0 restart or start "

None of this has ever caused problems.

and everytime the box rebooted; an init script from  the livecd-tools would among other things do/check the network setup.

until today  it it would obey  to the choice done by net-setup  regarding  the use of dhcpcd or not

```
This script is : [b]/etc/init.d/autoconfig [/b] has among more code the following settings:

#!/sbin/runscript

# Copyright 1999-2005 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo/src/livecd-tools/autoconfig,v 1.55 2006/01/21 23:03:34 wolf31o2 Exp $

DHCP="yes"

DETECT="yes"

GPM="yes"

PCMCIA="no"

HOTPLUG="yes"

APM="yes"

ACPI="yes"

IDEDMA="yes"

ALSA="yes"

X11="no"
```

and we can specify there what we want it to autoconfigure at every reboot or script restart.

With the current autoconfig seetings this is what happens:

```
Network device eth0 detected, DHCP broadcasting for IP ...

Network device eth1 detected, DHCP broadcasting for IP ...
```

and it always worked for manual network setup, never re-doing  its manual settings and only changing something if needed for auto dhcp.

The problem  that  i am having is that until the update  of dhcpcd and coincidently with a kernel change of network drivers and also the network card; now at every reboot the autoconfig script when checking for the dhcp ip settings re-does  my network making it use dhcp insted of what i specified manually.

I know that  this sounds like the livecd-tools is the one to blame but i dont think  it is. it never caused this problem. until dhcpd was updated to this last version.

the problem  is that something about dhcpcd is re-doing my network ignoring what is specified in /etc/resolv/conf and /etc/conf.d/net

Even not using or runing  the net-setup script and autoconfig; the dhcpcd still  forces itself to re-do the network.

Sometime  the network crashes or if i restart it its changes the ip  to a auto specified one  that dhcpd keeps complaining that  is already in use.

Sometimes after a while  i just lose internet connectivity because of this.

Another interesting thing is that when it does not re-do /etc/conf.d/net   it still changes  the ip, which  i confirm with #ifconfig 

in order to get back to my wanted network settings i have to restart the network or the box sometimes.

and sometimes i get this output:

```
* Mounting network filesystems ...                                                                             

[ ok ]Error, requested ***.***.**.236 address is in use

Error, requested ***.***.**..236 address is in use                                                                                 

[ ok ]Error, dhcpConfig: ioctl SIOCADDRT: File exists

Error, requested ***.***.**.236 address is in use

Error, dhcpConfig: ioctl SIOCADDRT: File exists
```

another weird fact is that that ip ***.***.**.236 was never used anywhere in the network before.

Now conclusions and solutions:

a: i can stop using the dhcpdc script and just the net-setup. however i can never make net-setup to choose  the auto dhcp option 

because dhcpcd is not instaled.

b: i can simple stop using net-setup and or the livecd-tools. (which some of you will probably tell me that its a livecd tool )

c: i can remove the autoconfig script but then, i wount have it working for other things

d: change the autoconfig script options regarding the DHCP. (this is what  i have done to 'solve; the issue')

e: find the reason why  this is happening and fix it.

So... what i have done so far was to change the autoconfig script auto detection settings to skip the dhpd.However if i set my network to use auto dhcp,  the autoconfig script will not run the auto detection at boot.

# nano  /etc/init.d/autoconfig 

```
This script is : [b]/etc/init.d/autoconfig [/b] has among more code the following settings:

#!/sbin/runscript

# Copyright 1999-2005 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo/src/livecd-tools/autoconfig,v 1.55 2006/01/21 23:03:34 wolf31o2 Exp $

DHCP="no"

DETECT="yes"

GPM="yes"

PCMCIA="no"

HOTPLUG="yes"

APM="yes"

ACPI="yes"

IDEDMA="yes"

ALSA="yes"

X11="no"
```

changing DHCP="yes" to DHCP="no" kinda solves the problem, but there is still  the fact that  this was never needed before to have all this working together with no problems.

Now at reboot or autoconfig restart this is the message:

 *Quote:*   

> * Skipping DHCP broadcast detection as requested on boot commandline ...

 

But i went to check a few more things around and found that the problem could be in dhcp cache

and i found /var/lib/dhcpc/ with a few cache network conf files, that had the ip address that dhcp kept trying to setup: (***.***.**.236) and removed everything  in that /dir.

so another step was done to fix  the rest  of the problem.

However now one  thing remains:

```
Error, dhcpConfig: ioctl SIOCADDRT: File exists

Error, dhcpConfig: ioctl SIOCADDRT: File exists
```

And the only place that  i find anything related to ioctl.cis  in the kernel.

I would like to have the autoconfig script and dhcpcd scripts running as before without  this dhcpConfig error when the box reboots, network starts/restarts or anything related to network changes.

Any ideas?

----------

## UberLord

Do you get this issue with older versions of dhcpcd?

----------

## HeXiLeD

No, only with the version that i posted.

Today i was out and when i got home my network was failing again. some programs lost connectivity while others were still running.

I also noticed that my conky eth0 traffic counter is giving me the same output both and down even without me doing anything related to downloads and uploads. This output is also giving strange high values.

I am now going to remove dhcpcd to see what happens.

----------

## cyblord

couuld this help at all?

https://forums.gentoo.org/viewtopic-t-464695-highlight-internet+dhcp.html

----------

## HeXiLeD

After removing dhcpcd the network worked fine. 

for some reason there seems to be a problem with  net-misc/dhcpcd 2.0.5 .

this problem might be isolated or somehow related to my network card driver.

cyblord : well not exactly but my network is using a "experimental" driver and its also a marvel card.

Ethernet controller: Marvell Technology Group Ltd. 88E8053 PCI-E Gigabit Ethernet Controller (rev 15)

currently using  the sky2 driver from vanilla-sources 2.6.16.16

at least  removing the dhcpcd from the system, has made things more stable.(the network kinda crashed again when i pushed things with vmware).

However i wonder if this is just the dhcpcd problem, or  dhcpcd + sky2 driver.

The reason that makes me say this is because there has been a few fixes for the driver in other  kernel versions:

http://kernel.org/pub/linux/kernel/v2.6/testing/ChangeLog-2.6.17-rc5

```
[PATCH] sky2: fix jumbo packet support

    

    The truncate threshold calculation to prevent receiver from getting stuck

    was incorrect, and it didn't take into account the upper limit on bits

    in the register so the jumbo packet support was broken.

[PATCH] sky2 version 1.4

    

    Need to track impact of this group of changes.

PATCH] skge: bad checksums on big-endian platforms

    

    Skge driver always causes  bad checksums on big-endian.

    The checksum in the receive control block was being swapped

    when it doesn't need to be.

 [PATCH] sky2: force NAPI repoll if busy

    

    If the status ring processing can't keep up with the incoming frames,

    it is more efficient to have NAPI keep scheduling the poll routine

    rather than causing another interrupt.

[PATCH] sky2: more fixes for Yukon Ultra

    

    Logic error in the phy initialization code. Also, turn on wake on lan

    bit in status control.

[PATCH] Subjec: sky2, skge: correct PCI id for DGE-560T

    

    The Dlink DGE-560T uses Yukon2 chipset so it needs sky2 driver; and

    the DGE-530T uses Yukon1 so it uses skge driver.

[PATCH] sky2: allow dual port usage

    

    If both ports are receiving on the SysKonnect dual port cards,

    then it appears the bus interface unit can give an interrupt status

    for frame before DMA has completed.  This leads to bogus frames

    and general confusion. This is why receive checksumming is also

    messed up on dual port cards.

    

    A workaround for the out of order receive problem is to eliminating

    split transactions on PCI-X.

    

    This version is based of the current linux-2.6.git including earlier

    patch to disable dual ports.

    sky2: prevent dual port receiver problems

    

    When both ports are receiving simultaneously, the receive logic gets confused

    and may pass up a packet before it is full. This causes hangs, and IP will see

    lots of garbage packets. There is even the potential for data corruption if

    a later arriving packet DMA's into freed memory.

    

    It looks like a hardware bug because status arrives for a packet but no

    data is there. Until this bug is worked out, block the user from bringing

    up both ports at once.

```

According to kernel.org the latest stable version of the Linux kernel is:  	2.6.16.19 	2006-05-31 00:30

http://kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.16.19

which i am waiting to see in portage. (please Dev's  :Wink:  & thank you )

----------

## HeXiLeD

I updated to vanilla 2.6.17-rc5 and removed dhcpcd and the network is stable.

After that  i installed dhcpcd and after restarting my services the error; Error, dhcpConfig: ioctl SIOCADDRT: File exists still showed up.

----------

## cyblord

how about this?

https://forums.gentoo.org/viewtopic-t-466163-highlight-dhcp+cyblord.html

----------

## HeXiLeD

cyblord from your url

 *Quote:*   

> "No loaded modules provide 'dhcp'". 

 

only happens when i unmerge dhcpcd and try to run anything that needs it.

----------

## UberLord

Questions

Does dhcpcd-2.0.3 work?

Does another dhcp client - like say pump - work?

If so could you post the output of ifconfig and route? thanks

----------

## HeXiLeD

 *Quote:*   

> Does dhcpcd-2.0.3 work? 

 

Well...  it  does not give this error:  Error, dhcpConfig: ioctl SIOCADDRT: File exists , but now it tries to give an autoip ( the same as before "***.***.**.236" - i guess it still must be cached somewhere)

 *Quote:*   

> 
> 
> Does another dhcp client - like say pump - work? 

 

Other dhcp clients dont really work because the /etc/init.d/autoconfig script, seems to be made to work only with dhcpcd.

I tried to change its code to work with other dhcp clients, but it didnt work

It its weird that /etc/conf.d/net is never re-writen / re-done or erased and even keeping  the manual settings that  i choose, the dhcp creates an alternative auto conf file in /var/lib/dhcp/ and uses it overiding /etc/conf.d/net.

Deleting  /var/lib/dhcp/, doesnt work because its auto created the next time  the service restarts.

Right now the network is stable, and i have net-misc/dhcpcd 2.0.5 instaled and using vanilla-sources 2.6.17_rc5 kernel and the sky2 marvel yukon network card driver with the latest bugfixes compliled staticly.

I also disabled the auto-dhcp detection in /etc/init.d/autoconfig script  from  the livecd-tools package

```
This script is : [b]/etc/init.d/autoconfig [/b] has among more code the following settings:

#!/sbin/runscript

# Copyright 1999-2005 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo/src/livecd-tools/autoconfig,v 1.55 2006/01/21 23:03:34 wolf31o2 Exp $

DHCP="NO"
```

This seems to be the only way now that i can keep all the packages that i had in the system; installed.

The only little changed done was in the autoconfig script.

For some reason dhcpcd 2.0.3 doesnt give me the  ioctl SIOCADDRT error, but since i tried 2.05 version, something must have gotten messed  up and now dhcpcd 2.0.3 also tries to use a certain ip like 2.0.5 does.

Changing the autoconfig script seems to workaround this issue.

If nobody else can replicate  this i guess i will add [SOLVED] to this topic.

----------

## UberLord

 *Blue-Steel wrote:*   

>  *Quote:*   Does dhcpcd-2.0.3 work?  
> 
> Well...  it  does not give this error:  Error, dhcpConfig: ioctl SIOCADDRT: File exists , but now it tries to give an autoip ( the same as before "***.***.**.236" - i guess it still must be cached somewhere)

 

Well 2.0.5 was the first version that had my improved error reporting, so the chances are that earlier versions did the same thing, but silently ignored the error.

You can remove the caches found in /var/lib/dhcpc and try again if you like - kill dhcpcd before cleaning the caches though.

 *Quote:*   

> 
> 
> Does another dhcp client - like say pump - work? 

 

Other dhcp clients dont really work because the /etc/init.d/autoconfig script, seems to be made to work only with dhcpcd.

I tried to change its code to work with other dhcp clients, but it didnt work.[/quote]

A pity. May I suggest ditching the autoconfig script and going with a pure baselayout setup?

BTW, 2.0.6 was put into the tree today - see how that works for you. I don't think it will fix your issue, but you never know. Also, you may want to try 2.0.0 as it's still in portage. Let me know if it works and I'll see if I can work out whats causing it.

----------

## HeXiLeD

Conclusions:

I tried dhcpcd 2.0.6 and still the problem didnt get solved. This time it  only complained about a certain ip already being used but this time it wasnt another ip; it was actually the one that was already being used and specified by me. This was the only positive change.

There are a few solutions to this issue at the moment:

a: dont use the livecd-tools package + dhcpcd

b: use the livecd-tools package but not  the dhcpcd (this will cause a small error if using 'net-setup' to setup auto dhcp)

c: use the dhcpcd but not the livecd-tools package

d: use livecd-tools package + dhcpcd and remove /etc/init.d/autoconfig script created by the livecd-tools install

e: d: use livecd-tools package + dhcpcd but do not add it to any rc-update run level

...finally i have choosen the following option due to the fact that allows me to keep  everything working 99.9%

F: keep the livecd-tools package + dhcpcd. Edit /etc/init.d/autoconfig and change DHCP="yes"  to DHCP="no"

```
This script is : [b]/etc/init.d/autoconfig [/b] has among more code the following settings:

#!/sbin/runscript

# Copyright 1999-2005 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo/src/livecd-tools/autoconfig,v 1.55 2006/01/21 23:03:34 wolf31o2 Exp $

DHCP="no"

DETECT="yes"

GPM="yes"

PCMCIA="no"

HOTPLUG="yes"

APM="yes"

ACPI="yes"

IDEDMA="yes"

ALSA="yes"

X11="no"
```

Currently i think that something else related to my network is caching some network settings that for some reason seem  to wanting to overide my manual settings  if i start  to 'mess around' with my network. Just a bit ago my domainname got "stuck" and restarting services, rebooting  the box and removing the conf, seemed not to help as the "box" kept using a 'cached" domainname and refusing  to read the confs that  i changed.

Related to this the only thing that i found to be caching my network settings was  /var/lib/dhcpc/

weird as it seems i have another box with the same packages and settings, and this problem doesnt happen there.

I will consider this issue SOLVED by workaround with option 'F'

----------

