From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1WcIE2-0004it-Ql for mharc-grub-devel@gnu.org; Mon, 21 Apr 2014 13:41:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcIDw-0004V1-AV for grub-devel@gnu.org; Mon, 21 Apr 2014 13:41:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WcIDr-0000Or-BW for grub-devel@gnu.org; Mon, 21 Apr 2014 13:41:44 -0400 Received: from mail-la0-x235.google.com ([2a00:1450:4010:c03::235]:47900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcIDq-0000OR-Pf for grub-devel@gnu.org; Mon, 21 Apr 2014 13:41:39 -0400 Received: by mail-la0-f53.google.com with SMTP id b8so3432770lan.12 for ; Mon, 21 Apr 2014 10:41:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=B9yIJLM69E/Lbkn6Z11yOrwMxRl0K9Wd5pXbdXjF/cs=; b=kS8XFWcxseSR+/AO/65LdNbXAu/DvX95hZXuinfE5a74gB7w3It/CsnvlRatq+MM5w KZ7ftk9pXA2k3fYLbpeZLc9Vt2qgNc16O4oCHLQWpwHaLKP0EdHkwPir8vsXbxLlvMZU Dm6vVY9pA1O4u9B2hLnCWpi5hClAtbSEFiIHx20RL6zAxrRSBYdCTkuT9+UDveaeTffr GPM64bDbFMf/iFivTkv9fHVpZRW84eg7pxiv6eQ+VaclB86/2RqheKgp7JJFYtLRADqa diHEivdFJg9r9tn4BkOuIXa96ILofVDXhOmNS/DNIoGcqEyhvsE09y8vhU1lMYtbSGjI voYw== X-Received: by 10.152.10.72 with SMTP id g8mr1964237lab.50.1398102097050; Mon, 21 Apr 2014 10:41:37 -0700 (PDT) Received: from opensuse.site (ppp37-190-15-130.pppoe.spdop.ru. [37.190.15.130]) by mx.google.com with ESMTPSA id oy7sm38024266lbb.16.2014.04.21.10.41.35 for (version=SSLv3 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Apr 2014 10:41:35 -0700 (PDT) Date: Mon, 21 Apr 2014 21:41:34 +0400 From: Andrey Borzenkov To: The development of GNU GRUB Subject: Re: RFC Remove classful causing incorrect routing behavior Message-ID: <20140421214134.22a5efdf@opensuse.site> In-Reply-To: <6D165E863E048E4D86C25F15CEA532979766FD0E@ORSMSX109.amr.corp.intel.com> References: <6D165E863E048E4D86C25F15CEA5329797665E90@ORSMSX109.amr.corp.intel.com> <5353D667.5040600@gmail.com> <6D165E863E048E4D86C25F15CEA532979766FD0E@ORSMSX109.amr.corp.intel.com> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.22; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::235 Cc: joseph.t.mroczek@intel.com X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 17:41:49 -0000 В Mon, 21 Apr 2014 15:56:07 +0000 "Mroczek, Joseph T" пишет: > > > > From: Behalf Of Vladimir 'f-coder/phcoder' Serbinenko > > On 19.04.2014 02:48, Mroczek, Joseph T wrote: > > > Hello: > > > > > > Currently, the DHCP logic assumes that if a gateway is received in the DHCP > > packet the boot server is on a remote network. Given that CIDR is now over > > 20 years old, I think it is a safe assumption that a netmask will be offered in > > DHCP options. > > > > > > Can this be removed? Or is there still a need to cover the classful case? > > > > > Please detail the failure scenario. > > Current code follows standard behaviour for PXE clients and changing it > > would break any installation which relies on it. > Hmm ... re-reading RFC2131 I ask myself what are conditions when *client* is supposed to use gateway_ip at all. According to RFC, giaddr is set by DHCP relay when it forwards request from client so server knows where to send reply to. DHCP relay then forwards reply on local subnet according to standard rules. RFC does not say anything about client usage of this field. Actually there is no requirement that DHCP relay also functions as normal router. PXE spec indeed mentions giaddr as possible source for gateway to connect to TFTP server, without going into much details how stack selects between multiple gateways if present. But grub does not call PXE TFTP, right? > The failure will occur in most if not all cases where the DHCP sends a gateway when the boot server is on the same subnet as the client, In view of the above, how is it possible? DHCP server is not supposed to set this field at all - at the most it simply replies back to relay with same value of giaddr it got. If giaddr is set it is already indication that server and client are on different subnets. > with the additional condition that the gateway and boot server are on > different hosts. There may be some routers that will forward the > traffic back on the local subnet, but most routers do not do this. The > net result is grub fails to contact the boot server. I am not sure > what you mean by standard behavior. Mulitple Intel option ROMs (i386 & > EFI), broadcom option ROMs, gPXE, Microsoft WDS, and syslinux/pxelinux > all route properly for local boot servers when both netmask and > gateway are set. > > The only use cases I could see breaking with this change require two conditions, one of which I would be very surprised to see. The two conditions are that the boot server is on a remote network (not-common but does happen), and the DHCP server does not send a subnet mask in options (rare to non-existent.) Not sending a subnet mask in this day and age is arguably broken behavior. > > ~joe > > > > > Thank you for any attention you can pay this matter. > > > > > > ~joe > > > > > > > > > diff -Naur grub-2.02~beta2/grub-core/net/bootp.c grub-2.02~beta2-jtm- > > clean/grub-core/net/bootp.c > > > --- grub-2.02~beta2/grub-core/net/bootp.c 2013-12-24 > > 11:40:31.000000000 -0500 > > > +++ grub-2.02~beta2-jtm-clean/grub-core/net/bootp.c 2014-04-18 > > 20:38:05.858208600 -0400 > > > @@ -191,18 +227,6 @@ > > > if (bp->gateway_ip) > > > { > > > grub_net_network_level_netaddress_t target; > > > - grub_net_network_level_address_t gw; > > > - char *rname; > > > - > > > - target.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; > > > - target.ipv4.base = bp->server_ip; > > > - target.ipv4.masksize = 32; > > > - gw.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; > > > - gw.ipv4 = bp->gateway_ip; > > > - rname = grub_xasprintf ("%s:gw", name); > > > - if (rname) > > > - grub_net_add_route_gw (rname, target, gw); > > > - grub_free (rname); > > > > > > target.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; > > > target.ipv4.base = bp->gateway_ip; > > > > > > _______________________________________________ > > > Grub-devel mailing list > > > Grub-devel@gnu.org > > > https://lists.gnu.org/mailman/listinfo/grub-devel > > > > > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel