discovery.c (256281) | discovery.c (263723) |
---|---|
1/*- 2 * Copyright (c) 2012 The FreeBSD Foundation 3 * All rights reserved. 4 * 5 * This software was developed by Edward Tomasz Napierala under sponsorship 6 * from the FreeBSD Foundation. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * | 1/*- 2 * Copyright (c) 2012 The FreeBSD Foundation 3 * All rights reserved. 4 * 5 * This software was developed by Edward Tomasz Napierala under sponsorship 6 * from the FreeBSD Foundation. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * |
29 * $FreeBSD: stable/10/usr.sbin/ctld/discovery.c 255570 2013-09-14 15:29:06Z trasz $ | 29 * $FreeBSD: stable/10/usr.sbin/ctld/discovery.c 263723 2014-03-25 12:10:30Z trasz $ |
30 */ 31 32#include <assert.h> 33#include <stdint.h> 34#include <stdio.h> 35#include <stdlib.h> 36#include <string.h> 37#include <netinet/in.h> --- 143 unchanged lines hidden (view full) --- 181 if (strcmp(send_targets, "All") == 0) { 182 TAILQ_FOREACH(targ, 183 &conn->conn_portal->p_portal_group->pg_conf->conf_targets, 184 t_next) { 185 if (targ->t_portal_group != 186 conn->conn_portal->p_portal_group) { 187 log_debugx("not returning target \"%s\"; " 188 "belongs to a different portal group", | 30 */ 31 32#include <assert.h> 33#include <stdint.h> 34#include <stdio.h> 35#include <stdlib.h> 36#include <string.h> 37#include <netinet/in.h> --- 143 unchanged lines hidden (view full) --- 181 if (strcmp(send_targets, "All") == 0) { 182 TAILQ_FOREACH(targ, 183 &conn->conn_portal->p_portal_group->pg_conf->conf_targets, 184 t_next) { 185 if (targ->t_portal_group != 186 conn->conn_portal->p_portal_group) { 187 log_debugx("not returning target \"%s\"; " 188 "belongs to a different portal group", |
189 targ->t_iqn); | 189 targ->t_name); |
190 continue; 191 } | 190 continue; 191 } |
192 keys_add(response_keys, "TargetName", targ->t_iqn); | 192 keys_add(response_keys, "TargetName", targ->t_name); |
193 } 194 } else { 195 targ = target_find(conn->conn_portal->p_portal_group->pg_conf, 196 send_targets); 197 if (targ == NULL) { 198 log_debugx("initiator requested information on unknown " 199 "target \"%s\"; returning nothing", send_targets); 200 } else { | 193 } 194 } else { 195 targ = target_find(conn->conn_portal->p_portal_group->pg_conf, 196 send_targets); 197 if (targ == NULL) { 198 log_debugx("initiator requested information on unknown " 199 "target \"%s\"; returning nothing", send_targets); 200 } else { |
201 keys_add(response_keys, "TargetName", targ->t_iqn); | 201 keys_add(response_keys, "TargetName", targ->t_name); |
202 } 203 } 204 keys_save(response_keys, response); 205 206 pdu_send(response); 207 pdu_delete(response); 208 keys_delete(response_keys); 209 pdu_delete(request); --- 12 unchanged lines hidden --- | 202 } 203 } 204 keys_save(response_keys, response); 205 206 pdu_send(response); 207 pdu_delete(response); 208 keys_delete(response_keys); 209 pdu_delete(request); --- 12 unchanged lines hidden --- |