From: Detlev Zundel Date: Fri, 10 Aug 2007 12:38:15 +0200 Subject: [U-Boot-Users] [PATCH] New CONFIG_BOOTP_SERVER option In-Reply-To: <20070809202608.9F6E6353428@atlas.denx.de> (Wolfgang Denk's message of "Thu\, 09 Aug 2007 22\:26\:08 +0200") References: <20070809202608.9F6E6353428@atlas.denx.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Wolfgang, > In message you wrote: >> Added CONFIG_BOOTP_SERVER to allow the tftp server to be different >> from the bootp server > > Sorry for the late review... > > Which problem is this patch supposed to fix? Doesn't the "nextserver" > option in your DHCP server config file do exactly what you want? I would not say it tries to "fix a problem" but rather "add an option". In my opinion next-server really serves the same purpose, but of course out of reach of U-Boot. So we gain more freedom in regard to misconfigured DHCP servers. >> index b3ccdce..581dbf7 100644 >> --- a/include/cmd_confdefs.h >> +++ b/include/cmd_confdefs.h >> @@ -169,6 +169,7 @@ >> #define CONFIG_BOOTP_SEND_HOSTNAME 0x00000100 >> #define CONFIG_BOOTP_NTPSERVER 0x00000200 >> #define CONFIG_BOOTP_TIMEOFFSET 0x00000400 >> +#define CONFIG_BOOTP_SERVER 0x00000800 >> #define CONFIG_BOOTP_VENDOREX 0x80000000 >> @@ -178,7 +179,8 @@ >> #define CONFIG_BOOTP_DEFAULT (CONFIG_BOOTP_SUBNETMASK | \ >> CONFIG_BOOTP_GATEWAY | \ >> CONFIG_BOOTP_HOSTNAME | \ >> - CONFIG_BOOTP_BOOTPATH) >> + CONFIG_BOOTP_BOOTPATH | \ >> + CONFIG_BOOTP_SERVER) >> #ifndef CONFIG_BOOTP_MASK >> #define CONFIG_BOOTP_MASK CONFIG_BOOTP_DEFAULT >> diff --git a/net/bootp.c b/net/bootp.c >> index 1de9a8f..2c05f2e 100644 >> --- a/net/bootp.c >> +++ b/net/bootp.c >> @@ -120,10 +120,12 @@ static void BootpCopyNetParams(Bootp_t *bp) >> IPaddr_t tmp_ip; >> NetCopyIP(&NetOurIP, &bp->bp_yiaddr); >> +#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_SERVER) >> NetCopyIP(&tmp_ip, &bp->bp_siaddr); >> if (tmp_ip != 0) >> NetCopyIP(&NetServerIP, &bp->bp_siaddr); >> memcpy (NetServerEther, ((Ethernet_t *)NetRxPkt)->et_src, 6); >> +#endif > > If I understand corrrectly, this patch changes the behaviour for all > boards that currently don't define CONFIG_BOOTP_SERVER. > > Is this intentional? If I understand this correctly, because CONFIG_BOOTP_MASK is tested and I don't see anyone defining this, it will *not* touch any configuration right now. Subsequently for consistency the code in bootp.c _may_ move to also using this MASK variable but then many configs will have to be touched. Many configs potentially can simply move to CONFIG_BOOTP_DEFAULT. Cheers Detlev -- I propose that each copy of the OS should ship with an orange jumpsuit and sensory deprivation goggles, since all Vista users have been unilaterally declared 'enemy combatants' by the content apparatchiki" - Daniel Nevin. -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de