[SLOF] [PATCH 7/7] net-snk: Get rid of junk at the end of sent DHCPv6 packets

Thomas Huth thuth at redhat.com
Tue Dec 22 05:59:49 AEDT 2015


On 21/12/15 17:05, Stefan Berger wrote:
> On 12/17/2015 03:18 PM, Thomas Huth wrote:
>> Wireshark reports bad FCS values and trailing zeros for SLOF's
>> DHCPv6 packets. This happens due to two bugs. First, the length
>> given to send_ipv6() contained sizeof(struct ethhdr) - but
>> adding that length is the responsibility of the send_ipv6()
>> function itself, the upper layers must not add this length yet.
>> Second, struct option_request was defined with 5 options, but
>> the code only uses 3 options instead. So when the code uses
>> sizeof(struct dhcp_message_header) (which contains the struct
>> option_request), there were additional unused bytes appended
>> to the message.
>>
>> Signed-off-by: Thomas Huth <thuth at redhat.com>
>> ---
>>   clients/net-snk/app/netlib/dhcpv6.c | 8 +++-----
>>   clients/net-snk/app/netlib/dhcpv6.h | 4 +++-
>>   2 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/clients/net-snk/app/netlib/dhcpv6.c
>> b/clients/net-snk/app/netlib/dhcpv6.c
>> index 05e9fcd..1a4ce6d 100644
>> --- a/clients/net-snk/app/netlib/dhcpv6.c
>> +++ b/clients/net-snk/app/netlib/dhcpv6.c
>> @@ -70,16 +70,14 @@ send_info_request(int fd)
>>       dhcph->option.el_time.length = 2;
>>       dhcph->option.el_time.time = 0x190; /* 4000 ms */
>>       dhcph->option.option_request_option.code = DHCPV6_OPTION_ORO;
>> -    dhcph->option.option_request_option.length= 6;
>> +    dhcph->option.option_request_option.length=
>> DHCPV6_OPTREQUEST_NUMOPTS * 2;
> 
> nit: space before '=' ?

Ok, I'll fix it! (I need to send a v2 anyway to improve the first patch)

 Thomas



More information about the SLOF mailing list