Project

General

Profile

Actions

Bug #2511

closed
PL

DHCPv6 Shows Wrong DUID

Bug #2511: DHCPv6 Shows Wrong DUID

Added by Phil Lavin about 14 years ago. Updated about 13 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
DHCP (IPv6)
Target version:
Start date:
06/21/2012
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
2.1
Affected Architecture:

Description

The DHCPv6 server is issuing leases. It has issued 2a02:b90:7004:4000::8710 to a Windows 7 PC and displays the DUID as 00:01:00:01:13:3e:df:a4:ba:db:03:7f:ba. I have used this to add a static mapping. This static mapping failed to work. Having run wireshark on the Windows PC and looked at the Solicit, the DUID it actually sends is 00:01:00:01:13:3e:df:3b:a4:ba:db:03:7f:ba. You'll see the one pfsense displays is missing a single "3b" before the MAC address. Changing the mapping manually to use the DUID from Wireshark causes it to issue the mapped address correctly.

There are 11 mappings in total, 3 of them have this issue. One is the above mentioned Windows 7 PC and the other 2 are Ubuntu PCs. Other Windows 7 PCs on the network work correctly. I don't have the correct DUIDs of the 2 Ubuntu PCs but I can obtain these if it'd be of any use.


Files

dhcpd.leases (13.1 KB) dhcpd.leases Phil Lavin, 06/22/2012 03:47 AM
dhcpd6.leases (13.7 KB) dhcpd6.leases Phil Lavin, 06/22/2012 08:52 AM
dhcpd6.leases~ (430 Bytes) dhcpd6.leases~ Jeroen van der Wal, 06/19/2013 08:20 AM

SM Updated by Seth Mos about 14 years ago Actions #1

ok, wow, I think those DUID values we show are straight from the dhcp leases file. Could be a bug in dhcpd.
Needs more research.

PL Updated by Phil Lavin about 14 years ago Actions #2

Where is this file? I'll check the DUIDs in it.

JP Updated by Jim Pingle about 14 years ago Actions #3

It's in /var/dhcp/var/db/dhcpd6.leases - but it's encoded.

It's possible there is a buglet in the parsing code, DHCP's encoding of that field is not something I am fond of at all.

It works for me on my Windows 7 box though, I added the DUID from the leases view and it does pick up and use that IP.

PL Updated by Phil Lavin about 14 years ago Actions #4

Here's the file, if it helps. As above, DUID Windows reports is:

00-01-00-01-13-3E-DF-3B-A4-BA-DB-03-7F-BA

DUID pfsense reports is:

00:01:00:01:13:3e:df:a4:ba:db:03:7f:ba

IP it gets is:

2a02:b90:7004:4000::8710

IP it's configured to get (using the DUID pfsense reports) is:

2a02:b90:7004:4000::102

PL Updated by Phil Lavin about 14 years ago Actions #5

Sorry, that's the wrong file. Right one attached.

Phil

PL Updated by Phil Lavin about 14 years ago Actions #6

Got bored at work... don't tell the boss. Found the issue.

The awk clean pattern in status_dhcpv6_leases.php removes semi colons - gsub(";", "")

The encoded DUID has a semi colon in it - \333\272\244\016\000\001\000\001\023>\337;\244\272\333\003\177\272

Running the real DUID through parse_duid() works so I think this is the only issue. I assume someone removed semi colons for a valid reason?

PL Updated by Phil Lavin about 14 years ago Actions #7

Having thought about it a little more, it's probably to strip the ; from the end of the lines. Suggested fix is to add a $ to make gsub(";$", "")

Phil

JP Updated by Jim Pingle about 14 years ago Actions #8

Did you make and test that change? Did that make it show the proper DUID for you?

PL Updated by Phil Lavin about 14 years ago Actions #9

It does. Also had a look around and nothing appears broken as a result. To clarify, line 152ish of status_dhcpv6_leases.php changed to:

$cleanpattern = "'{ gsub(\"^#.*\", \"\");} { gsub(\"^server-duid.*\", \"\");} { gsub(\";$\", \"\"); print;}'";

Shouldn't need to escape the newly added $ unless you want to do so for clarity that it's not part of a variable.

JP Updated by Jim Pingle about 14 years ago Actions #10

I tried it on mine as well with a somewhat lengthy dhcpv6.leases file and it appears to have parsed everything OK still.

I committed the change, it should show up here momentarily.

JP Updated by Jim Pingle about 14 years ago Actions #11

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

Applied in changeset commit:0f03ae0fb50ff10e2e41566ee04ce974c05b2670.

JP Updated by Jim Pingle about 14 years ago Actions #12

  • Status changed from Feedback to Resolved

JV Updated by Jeroen van der Wal about 13 years ago Actions #13

I seem to have a similar problem.

A windows 8 client with the DUID 00:01:00:01:18:1c:59:c5:00:25:22:92:f5:43 (verified with wireshark) displays as 0f:00:01:00:01:18:1c:59:c5:00:25:22:22:92:f5:43 on the web interface.
It adds 0f at the start and 22 in the middle.

Actions

Also available in: Atom