ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/hopm/branches/1.1.x/src/libopm/src/config.c
(Generate patch)

Comparing hopm/trunk/src/libopm/src/config.c (file contents):
Revision 5164 by michael, Fri Dec 26 18:52:10 2014 UTC vs.
Revision 5170 by michael, Fri Dec 26 20:53:09 2014 UTC

# Line 195 | Line 195 | OPM_ERR_T libopm_config_set(OPM_CONFIG_T
195           break;
196  
197        case OPM_TYPE_ADDRESS:
198 <      {
199 <        struct addrinfo hints, *res;
200 <
201 <        memset(&hints, 0, sizeof(hints));
202 <        hints.ai_family   = AF_INET;
203 <        hints.ai_socktype = SOCK_STREAM;
204 <        hints.ai_flags    = AI_PASSIVE | AI_NUMERICHOST;
205 <
206 <        if (getaddrinfo(value, NULL, &hints, &res))
198 >        if (inet_pton(AF_INET, value, &(((opm_sockaddr *)config->vars[key])->sa4.sin_addr)) <= 0)
199            return OPM_ERR_BADVALUE;  /* return appropriate err code */
200  
209        memcpy(&(((opm_sockaddr *)config->vars[key])->sa4.sin_addr), &((struct sockaddr_in *)res->ai_addr)->sin_addr, sizeof(struct in_addr));
210        freeaddrinfo(res);
201          break;
212      }
202  
203        case OPM_TYPE_STRINGLIST:
204           node = libopm_node_create(libopm_xstrdup(value));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines