Print this page
inet_pton

*** 20,29 **** --- 20,30 ---- */ /* * Copyright 2000 by Cisco Systems, Inc. All rights reserved. * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * * iSCSI Software Initiator */ #include <sys/types.h>
*** 241,252 **** size_t hostent_size = ISCSI_DOOR_MAX_DATA_SIZE; size_t buffer_size; getipnodebyname_req_t *req; getipnodebyname_cnf_t *cnf; struct hostent *hptr; - int i; - uint16_t *swap; buffer_size = msg_size + hostent_size + sizeof (mybuffer_t); buffer = (mybuffer_t *)kmem_zalloc(buffer_size, KM_SLEEP); --- 242,251 ----
*** 310,330 **** return (NULL); } if (inet_pton(af, (char *)name, cnf) == 1) { /* * inet_pton converted the string successfully. - * reset to network order. swaps based on nfs code */ - if (af == AF_INET) { - *((uint32_t *)cnf) = htonl(*((uint32_t *)cnf)); - } else { - for (swap = ((void *)cnf), i = 0; - i < hptr->h_length / sizeof (uint16_t); - i++) { - swap[i] = htons(swap[i]); - } - } hptr->h_addrtype = af; hptr->h_addr_list = (char **)((char *)hptr + sizeof (struct hostent)); *hptr->h_addr_list = (char *)cnf; return (hptr); --- 309,319 ----