[ovs-dev] [PATCH v6] pinctrl: Check requested IP in DHCPREQUEST messages

Gregory Smith gasmith at nutanix.com
Wed Dec 12 18:52:04 UTC 2018


Ben Pfaff wrote:
> On Wed, Dec 12, 2018 at 04:26:37PM +0000, Gregory Smith wrote:
> > See RFC 2131, section 4.3.2. When handling a DHCPREQUEST message, the
> > server should validate that the client's requested IP matches the
> > offered IP. If not, the server should reply with a DHCPNAK. The client's
> > requested IP is either specified as the Requested IP Address (option
> > 50), or as the ciaddr, depending on the client's state.
> > 
> > Signed-off-by: Gregory Smith <gasmith at nutanix.com>
> 
> Thanks for v6!
> 
> This version still has a couple of ALIGNED_CASTs of pointers that are
> not necessarily aligned.  Please allow me to suggest another strategy.
> First, let's make dhcp_header a packed struct.  Packing can have
> performance implications, as I understand it, but DHCP packet processing
> is not performance-critical.  Second, let's take advantage of that to
> avoid needing to assume alignment.
> 
> I'm going to post a 2-patch series where the first patch packs
> dhcp_header and the second one is a small variant of yours.  Here's an
> incremental showing how I'm proposing to change your patch:

Thank you for the assist! The 2-patch series looks good to me.

Greg


More information about the dev mailing list