v4.0.x - DHCP - incomplete decoding of IPv4 attribute

Arran Cudbard-Bell a.cudbardb at freeradius.org
Mon Feb 19 22:24:04 CET 2018



> On Feb 19, 2018, at 6:16 PM, Chaigneau, Nicolas <nicolas.chaigneau at capgemini.com> wrote:
> 
> I know Arran is working on the DHCP code, so maybe it's already known.
> Just in case...
> 
> In function fr_dhcpv4_packet_decode:
> 
> https://github.com/FreeRADIUS/freeradius-server/blob/ce6c2c641194a49b70d6c6e9335f900d5f0a699c/src/protocols/dhcpv4/packet.c#L162
> 
>                               case FR_TYPE_IPV4_ADDR:
>                                               memcpy(&vp->vp_ipv4addr, p, 4);
>                                               break;
> 
> 
> I had to add the following two lines after the memcpy:
> 
>                                               vp->data.vb_ip.af = AF_INET;
>                                               vp->data.vb_ip.prefix = 32;

Nah that's the DHCPv4 code, haven't touched that.  I'm working on v6.  Just swapped out most of that switch statement for a call to fr_value_box_from_network... woo code reuse.

-Arran
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 874 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.freeradius.org/pipermail/freeradius-devel/attachments/20180219/1fb074c1/attachment.sig>


More information about the Freeradius-Devel mailing list