From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sasha Levin Subject: Re: [PATCH] [dhcp] Use random transaction ID to associate messages Date: Thu, 15 Sep 2011 17:53:02 +0300 Message-ID: <1316098382.3743.23.camel@lappy> References: <139746928.693408.1316097790460.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Yaniv Kaul , etherboot-developers@lists.sourceforge.net, jasowang@redhat.com, mdc@etherboot.org, ehabkost@redhat.com, kvm@vger.kernel.org, Hagen Paul Pfeifer , ipxe-devel@ipxe.org To: Amos Kong Return-path: Received: from mail-fx0-f46.google.com ([209.85.161.46]:39932 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933898Ab1IOOxh (ORCPT ); Thu, 15 Sep 2011 10:53:37 -0400 Received: by fxe4 with SMTP id 4so713889fxe.19 for ; Thu, 15 Sep 2011 07:53:35 -0700 (PDT) In-Reply-To: <139746928.693408.1316097790460.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, 2011-09-15 at 10:43 -0400, Amos Kong wrote: > ----- Original Message ----- > > ----- Original Message ----- > > > On Thu, 15 Sep 2011 21:00:38 +0800, Amos Kong > > > wrote: > > > > > > > + netdev->xid = random(); > > > > > > This will not work for reboots. The decision that the hardware > > > address > > > is > > > choosen was not accidental. Not sure if some DHCP server will count > > > on > > > the > > > ID. (RFC 2131 "Retain DHCP client configuration across server > > > reboots, > > > and, > > > whenever possible, a DHCP client should be assigned the same > > > configuration > > > parameters despite restarts of the DHCP mechanism"). If not so I am > > > fine > > > with the patch. > > Hi Hagen, > > rfc2131 clearly describes that we need a random xid, > I don't think xid is a port of "DHCP client configuration", > it only be used to associate messages and responses between client and server. > > I would post a patch to ipxe maillist later if it's ok. rfc2131 only required that "A DHCP client MUST choose 'xid's in such a way as to minimize the chance of using an 'xid' identical to one used by another client.". The 'random xid' suggestion is listed merely as an example. The way I see it using a xid based on MAC instead of a random number is safer since the odds for same MAC on the same network are pretty slim since it would cause problems on other layers in the network. Whats the reason behind this patch? Whats wrong with current selection of xid? -- Sasha.