Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
Kea
Kea
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 450
    • Issues 450
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 75
    • Merge Requests 75
  • Operations
    • Operations
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • ISC Open Source Projects
  • KeaKea
  • Issues
  • #651

Closed
Open
Opened Jun 04, 2019 by Cathy Almond@cathyaDeveloper

DHCPv6 lease updates failing for some clients (postgresql)

As reported to Support in ticket RT 14761

Describe the bug This is a possible bug inside the postgresql lease manager which makes ipv6 lease updates impossible for some clients.

The ipv6 ia_id is stored in a column called "iaid" in the "lease6" table. We noticed that sometimes there is a negative value inside this column, and this are exactly the hosts, for which ipv6 lease updates fail.

The dhcpv6 ia_id is a 32 bit unsigned integer, which is (for database compatibility) obviously casted to a 32 bit signed integer inside pgsql_lease_mgr.cc.

But when one of the functions

  • PgSqlLeaseMgr::getLeases6(Lease::Type lease_type, const DUID& duid, uint32_t iaid);
  • PgSqlLeaseMgr::getLeases6(Lease::Type lease_type, const DUID& duid, uint32_t iaid, SubnetID subnet_id); is called, inside the function the iaid is not being converted/casted to a signed int, which leads to a wrong database query. As a result the dhcp lease with the searched iaid is not found and a new ipv6 lease is created for this client with every dhcpv6 request.

As a (temporary) fix we created a simple patch for the pgsql_lease_mgr.cc, which is attached to this ticket. With this patch the dhcpv6 lease update works as expected.

Environment: We are using kea 1.4.0-P1 with postgresql as database backend.

The bug seems to be present also in version 1.5.0/1.6.0, although we didn't test it.

Additional Information This looks like it might be similar to #181 ?

kea-1.4.0-P1-iaid-postgresql.patch

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Kea1.6-beta2
Milestone
Kea1.6-beta2 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: isc-projects/kea#651