[settings] Explicitly separate the concept of a completed fetched setting

The fetch_setting() family of functions may currently modify the
definition of the specified setting (e.g. to add missing type
information).  Clean up this interface by requiring callers to provide
an explicit buffer to contain the completed definition of the fetched
setting, if required.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2013-12-05 00:37:02 +00:00
parent a2638a8edd
commit 22001cb206
37 changed files with 620 additions and 573 deletions
+4 -4
View File
@@ -236,8 +236,8 @@ static int trivial_init ( struct net80211_device *dev )
dev->associating->crypto == NET80211_CRYPT_NONE )
return 0; /* no crypto? OK. */
len = fetch_setting ( netdev_settings ( dev->netdev ),
&net80211_key_setting, key, WEP_MAX_KEY );
len = fetch_raw_setting ( netdev_settings ( dev->netdev ),
&net80211_key_setting, key, WEP_MAX_KEY );
if ( len <= 0 ) {
DBGC ( dev, "802.11 %p cannot do WEP without a key\n", dev );
@@ -278,8 +278,8 @@ static int trivial_change_key ( struct net80211_device *dev )
if ( ! dev->crypto || ( dev->crypto->init != wep_init ) )
change ^= 1;
len = fetch_setting ( netdev_settings ( dev->netdev ),
&net80211_key_setting, key, WEP_MAX_KEY );
len = fetch_raw_setting ( netdev_settings ( dev->netdev ),
&net80211_key_setting, key, WEP_MAX_KEY );
if ( len <= 0 )
change ^= 1;