[Kea-users] Option 60 vendor class

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Kea-users] Option 60 vendor class

itay cohen
Hello all

I’m trying to catch option 60 with a hook and send it as text to log file
But every time I set getData to it kea crash

Can you advise ?

Thank you
Itay

_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users
Reply | Threaded
Open this post in threaded view
|

Re: [Kea-users] Option 60 vendor class

Francis Dupont
vendor-class-identifier (code 60) is a string so you should dynamic cast
the result of getOption() with DHO_VENDOR_CLASS_IDENTIFIER to
an OptionString. There are a lot of examples in unit tests and
as far as I can remember at least a post in this list as you are not
the first asking this.

Regards

Francis Dupont <[hidden email]>

PS: look at src/lib/dhcp/std_option_defs.h for definitions of standard
options. getData works only on unknown options or options which are not
defined to a specific content type (i.e, binary).
_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users
Reply | Threaded
Open this post in threaded view
|

Re: [Kea-users] Option 60 vendor class

Marcin Siodelski
On 13.04.2018 14:03, Francis Dupont wrote:

> vendor-class-identifier (code 60) is a string so you should dynamic cast
> the result of getOption() with DHO_VENDOR_CLASS_IDENTIFIER to
> an OptionString. There are a lot of examples in unit tests and
> as far as I can remember at least a post in this list as you are not
> the first asking this.
>
> Regards
>
> Francis Dupont <[hidden email]>
>
> PS: look at src/lib/dhcp/std_option_defs.h for definitions of standard
> options. getData works only on unknown options or options which are not
> defined to a specific content type (i.e, binary).
> _______________________________________________
> Kea-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/kea-users
>

Francis,

The OptionString actually using data_ member (setData, getData) to
storing string values, so it should not be a reason to crash. I think it
is going to be hard to rootcause the problem without seeing the actual code.

Marcin Siodelski
ISC
_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users