From: Robert P. J. Day Date: Sun, 2 Oct 2016 03:19:56 -0400 (EDT) Subject: [U-Boot] is there any issue with creating and using more than one hashtable? In-Reply-To: <20161001081331.045ED100C3C@atlas.denx.de> References: <20161001081331.045ED100C3C@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 On Sat, 1 Oct 2016, Wolfgang Denk wrote: ... snip ... > Actually the TFTP will not access the environment directly to > determine the boot parameters like bootfile, ipaddr, gatewayip, > netmask, serverip, etc.; instead, it uses internal variables. So > your environment settings for "ipaddr" and "gatewayip" may contain > totally different values than the variables net_ip resp. > net_gateway which get used by the TFTP code. > > These variables get set through the U_BOOT_ENV_CALLBACK functionality, > i. e. as a callback whenever the corresponfing variable gets set. > "setting" here means that the value in the hash table gets changed - > see function _compare_and_overwrite_entry() in "hashtable.c": > > 244 /* If there is a callback, call it */ > 245 if (htab->table[idx].entry.callback && > 246 htab->table[idx].entry.callback(item.key, > 247 item.data, env_op_overwrite, flag)) { > 248 debug("callback() rejected setting variable " > 249 "%s, skipping it!\n", item.key); > 250 __set_errno(EINVAL); > 251 *retval = NULL; > 252 return 0; > 253 } ... snip ... i'm going to assume other net-related commands have this behaviour as well, yes? like ping? which would explain why ping'ing even the alleged gateway didn't work in this context. rday -- ======================================================================== Robert P. J. Day Ottawa, Ontario, CANADA http://crashcourse.ca Twitter: http://twitter.com/rpjday LinkedIn: http://ca.linkedin.com/in/rpjday ========================================================================