Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Kea Kea
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 554
    • Issues 554
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 65
    • Merge requests 65
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source ProjectsISC Open Source Projects
  • KeaKea
  • Issues
  • #1585
Closed
Open
Issue created Dec 02, 2020 by Peter Davies@peterdDeveloper

1.5.0-P1: configuration error - Attempt to parse truncated vendor option

name: 1.5.0-P1: configuration error - Attempt to parse truncated vendor option

Describe the bug The following configuration error is generated when defining option 125 encapsulated option space:
2020-12-02 00:20:23.376 ERROR [kea-dhcp4.dhcp4/130] DHCP4_CONFIG_LOAD_FAIL configuration error using file: kea-dhcp4.conf.test, reason: option data does not match option definition (space: vendor-encapsulated-options-space, code: 125): Attempt to parse truncated vendor option (kea-dhcp4.conf.test:42:19)
2020-12-02 00:20:23.376 ERROR [kea-dhcp4.dhcp4/130] DHCP4_INIT_FAIL failed to initialize Kea server: configuration error using file 'kea-dhcp4.conf.test': option data does not match option definition (space: vendor-encapsulated-options-space, code: 125): Attempt to parse truncated vendor option (kea-dhcp4.conf.test:42:19)

Customer reports that on investigation the problem occurs at:
src/lib/dhcp/libdhcp++.cc source, function unpackVendorOptions4 when parsing option value.
It would appear that for some reason 43.125 is treated as just 125 (parent option) and the vendor ID (4-byte unsigned integer) + length octet + data is expected – and that is where error is thrown. This function is called from OptionVendor class, method unpack in option_vendor.cc source.

See RT #17358

To Reproduce
The following configuration:

{   
    "Dhcp4": {  
        "valid-lifetime": 3600,  
        "echo-client-id": true,  
        "interfaces-config": {  
            "interfaces": [  
                "*"  
            ],  
            "re-detect": true,  
            "dhcp-socket-type": "raw",  
            "outbound-interface": "same-as-inbound"  
        },   
        "control-socket": {
            "socket-type": "unix",  
            "socket-name": "/tmp/kea4_command"
        },  
        "lease-database": {  
            "type": "memfile",  
            "persist": true,  
            "name": "/tmp/dhcp4.leases",  
            "lfc-interval": 3600  
        },  
        "sanity-checks": {  
            "lease-checks": "fix"  
        },  
        "subnet4": [  
            {  
                "subnet": "10.0.20.0/24",  
                "match-client-id": true  
            }  
        ],  
    "option-def": [  
        {  
            "name": "cookie",  
            "code": 125,  
            "type": "string",  
            "space": "ABC"  
        }  
    ],  
    "client-classes": [  
        {  
            "name": "ABC",  
            "test": "(option[vendor-class-identifier].text == 'ABC')",  
            "option-def": [  
                {  
                    "name": "vendor-encapsulated-options",  
                    "code": 43,  
                    "type": "empty",  
                    "encapsulate": "ABC"  
                }
            ],
            "option-data": [  
                {  
                    "name": "cookie",  
                    "space": "ABC",  
                    "data": "1ABCDE"  
                },  
                {  
                    "name": "vendor-encapsulated-options"  
                }  
            ]  
        }  
    ]  
},  
    "Logging": {  
        "loggers": [  
            {  
                "name": "kea-dhcp4",  
                "output_options": [  
                    {  
                        "output": "/tmp/kea_log"  
                    }  
                ],  
                "severity": "DEBUG",  
                "debuglevel": 99  
            }  
          ]  
         }  
}

Also note that using a 4 byte string (for example "1APC") does allow Kea to start up

Edited Dec 29, 2020 by Tomek Mrugalski
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking