|
Lines 463-469
ipv4_create(struct inet_port *port, struct inet_po
Link Here
|
| 463 |
if (params->addr_len != 4) |
463 |
if (params->addr_len != 4) |
| 464 |
return (SNMP_ERR_INCONS_VALUE); |
464 |
return (SNMP_ERR_INCONS_VALUE); |
| 465 |
|
465 |
|
| 466 |
memcpy(&ip, params->addr, 4); |
466 |
memcpy(&ip, params->addr, 4); /* network byte order */ |
| 467 |
struct port_sock *sock = calloc(1, sizeof(struct port_sock)); |
467 |
struct port_sock *sock = calloc(1, sizeof(struct port_sock)); |
| 468 |
if (sock == NULL) |
468 |
if (sock == NULL) |
| 469 |
return (SNMP_ERR_GENERR); |
469 |
return (SNMP_ERR_GENERR); |
|
Lines 477-483
ipv4_create(struct inet_port *port, struct inet_po
Link Here
|
| 477 |
|
477 |
|
| 478 |
sin->sin_len = sizeof(struct sockaddr_in); |
478 |
sin->sin_len = sizeof(struct sockaddr_in); |
| 479 |
sin->sin_family = AF_INET; |
479 |
sin->sin_family = AF_INET; |
| 480 |
sin->sin_addr.s_addr = htonl(ip); |
480 |
sin->sin_addr.s_addr = ip; |
| 481 |
sin->sin_port = htons(params->port); |
481 |
sin->sin_port = htons(params->port); |
| 482 |
|
482 |
|
| 483 |
sock->port = port; |
483 |
sock->port = port; |