# [SOLVED] Dhcp and IPV6 trouble..

## Drain

Hello, i have a bad problem using my gentoobox at work, when i boot my notebook i can't connect successfully with dhcp because, i guess, dhcp server is not compatible with ipv6.

At home instead i can connect without any problem (seems my router likes ipv6)...

At boot time i receive these messages when i try to connect to the bad dhcp server:

```

Mar 10 17:27:04 gentoobox e100: eth0: e100_watchdog: link up, 100Mbps, full-duplex

Mar 10 17:27:04 gentoobox ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

Mar 10 17:27:04 gentoobox rc-scripts: Configuration not set for eth0 - assuming DHCP

Mar 10 17:27:04 gentoobox dhcpcd[6339]: eth0: dhcpcd 3.1.5 starting

Mar 10 17:27:04 gentoobox dhcpcd[6339]: eth0: hardware address = 00:16:d4:e5:a0:ad

Mar 10 17:27:04 gentoobox dhcpcd[6339]: eth0: DUID = 00:01:00:01:0e:c4:df:38:00:16:d4:e5:a0:ad

Mar 10 17:27:04 gentoobox dhcpcd[6339]: eth0: broadcasting for a lease

Mar 10 17:27:04 gentoobox dhcpcd[6339]: eth0: offered 10.17.66.98 from 10.204.88.21

Mar 10 17:27:04 gentoobox dhcpcd[6339]: eth0: option 42 has zero length

Mar 10 17:27:04 gentoobox dhcpcd[6339]: eth0: failed to parse packet

Mar 10 17:27:07 gentoobox dhcpcd[6339]: eth0: option 42 has zero length

Mar 10 17:27:07 gentoobox dhcpcd[6339]: eth0: failed to parse packet

Mar 10 17:27:10 gentoobox dhcpcd[6339]: eth0: option 42 has zero length

Mar 10 17:27:10 gentoobox dhcpcd[6339]: eth0: failed to parse packet

Mar 10 17:27:13 gentoobox dhcpcd[6339]: eth0: option 42 has zero length

Mar 10 17:27:13 gentoobox dhcpcd[6339]: eth0: failed to parse packet

Mar 10 17:27:15 gentoobox eth0: no IPv6 routers present

Mar 10 17:27:16 gentoobox dhcpcd[6339]: eth0: option 42 has zero length

Mar 10 17:27:16 gentoobox dhcpcd[6339]: eth0: failed to parse packet

Mar 10 17:27:19 gentoobox dhcpcd[6339]: eth0: option 42 has zero length

Mar 10 17:27:19 gentoobox dhcpcd[6339]: eth0: failed to parse packet

Mar 10 17:27:22 gentoobox dhcpcd[6339]: eth0: option 42 has zero length

Mar 10 17:27:22 gentoobox dhcpcd[6339]: eth0: failed to parse packet

Mar 10 17:27:24 gentoobox dhcpcd[6339]: eth0: timed out

Mar 10 17:27:24 gentoobox dhcpcd[6339]: eth0: exiting

```

so i ask you a trick to disable automatic check of an IPV6 address, when my net join a bad NOT-ipv6 dhcp server (or definitively disable it) ...

Thanks   :Smile: Last edited by Drain on Thu Mar 13, 2008 12:11 am; edited 1 time in total

----------

## UberLord

That ipv6 message is fine.

The error is simply that your dhcp server is sending a DHCP option we need with a length of zero. This is invalid, and dhcpcd doesn't like it. Tell your work IT guys to fix their DHCP server  :Smile: 

----------

## UberLord

You can also try this patch, which skips over zero length options. It's cut against dhcpcd-3.2.3, but may apply against your version.

http://roy.marples.name/dhcpcd/dhcpcd-zerolength.patch

----------

## Drain

 *UberLord wrote:*   

> You can also try this patch, which skips over zero length options. It's cut against dhcpcd-3.2.3, but may apply against your version.
> 
> http://roy.marples.name/dhcpcd/dhcpcd-zerolength.patch

 

thanks! i will try it ASAP... but how i have to apply the fix?

----------

## UberLord

Download the patch to /tmp.

Edit a dhcpcd ebuild in /usr/portage/net-misc/dhcpcd (3.1.5-r1 or later)

Add the word eutils to the inherit line at the top if not there already

Add this line to the src_unpack() function, just after the cd "${S}" line

```
epatch /tmp/dhcpcd-zerolength.patch
```

Now, emerge it as you would normally - if you don't see a message saying the patch was applied then you did it wrong.

OR, the manual way  :Smile: 

tar xvjpf /usr/portage/distfiles/dhcpcd-3.1.5.tar.bz2

cd dhcpcd-3.1.5

patch -p1 </tmp/dhcpcd-zerolength.patch

make

install dhcpcd /sbin

----------

## Drain

 *UberLord wrote:*   

> Download the patch to /tmp.
> 
> Edit a dhcpcd ebuild in /usr/portage/net-misc/dhcpcd (3.1.5-r1 or later)
> 
> Add the word eutils to the inherit line at the top if not there already
> ...

 

the manual way works great!

thank you UberLord, you're really Uber....

only another question, in future when i will update my gentoo with emerge -DuN world, shall i apply the patch again?

----------

## UberLord

 *Drain wrote:*   

> only another question, in future when i will update my gentoo with emerge -DuN world, shall i apply the patch again?

 

If dhcpcd is upgraded then yes.

The patch will be in dhcpcd-3.2.4, which hasn't been released yet.

----------

## Drain

 *UberLord wrote:*   

>  *Drain wrote:*   only another question, in future when i will update my gentoo with emerge -DuN world, shall i apply the patch again? 
> 
> If dhcpcd is upgraded then yes.
> 
> The patch will be in dhcpcd-3.2.4, which hasn't been released yet.

 

thanks   :Razz: 

----------

