On 03.08.2018 20:49, Roy Marples wrote: > On 03/08/2018 15:22, Robert Elz wrote: >> Whether there need to be any attention to the possibility >> of a malformed packet I will leave for Roy to decide (I am >> assuming probably not) but that added cast just looks to be >> a bandaid for a broken compiler (sanitiser). > > The contents are verified further up the stack. > I'm inclined to agree it's a dodgy compiler warning, but I'm not really > an expert here. > > Roy I've repeated the compiler error as I forgot the exact error message (it was fixed in a local branch a while ago): /public/src.git/external/bsd/dhcpcd/dist/src/dhcp.c: In function 'get_udp_data': /public/src.git/external/bsd/dhcpcd/dist/src/dhcp.c:3270:29: error: conversion to 'long unsigned int' from 'int' may change the sign of the result [-Werror=sign-conversion] *len = ntohs(p->ip.ip_len) - sizeof(p->ip) - sizeof(p->udp); ^ http://netbsd.org/~kamil/patch-00068-dhcpcd-get_udp_data.txt
Attachment:
signature.asc
Description: OpenPGP digital signature