diff options
author | Michael Brown | 2013-05-01 18:20:39 +0200 |
---|---|---|
committer | Michael Brown | 2013-05-01 20:52:12 +0200 |
commit | 15d2f947f51a0ea72e9938f5648fd5133950ecdb (patch) | |
tree | f53d0e87063b2c2972c3602ad8962332b3756a72 /src/net/dhcppkt.c | |
parent | [realtek] Defer packets when no transmit descriptors are available (diff) | |
download | ipxe-15d2f947f51a0ea72e9938f5648fd5133950ecdb.tar.gz ipxe-15d2f947f51a0ea72e9938f5648fd5133950ecdb.tar.xz ipxe-15d2f947f51a0ea72e9938f5648fd5133950ecdb.zip |
[settings] Eliminate settings "tag magic"
Create an explicit concept of "settings scope" and eliminate the magic
values used for numerical setting tags.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/dhcppkt.c')
-rw-r--r-- | src/net/dhcppkt.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/net/dhcppkt.c b/src/net/dhcppkt.c index 528f9003..3722c09e 100644 --- a/src/net/dhcppkt.c +++ b/src/net/dhcppkt.c @@ -230,7 +230,8 @@ static int dhcppkt_settings_applies ( struct settings *settings, struct dhcp_packet *dhcppkt = container_of ( settings, struct dhcp_packet, settings ); - return dhcppkt_applies ( dhcppkt, setting->tag ); + return ( ( setting->scope == NULL ) && + dhcppkt_applies ( dhcppkt, setting->tag ) ); } /** @@ -299,6 +300,6 @@ void dhcppkt_init ( struct dhcp_packet *dhcppkt, struct dhcphdr *data, dhcpopt_init ( &dhcppkt->options, &dhcppkt->dhcphdr->options, ( len - offsetof ( struct dhcphdr, options ) ), dhcpopt_no_realloc ); - settings_init ( &dhcppkt->settings, - &dhcppkt_settings_operations, &dhcppkt->refcnt, 0 ); + settings_init ( &dhcppkt->settings, &dhcppkt_settings_operations, + &dhcppkt->refcnt, NULL ); } |