| 3 | #include "util.h" |
| 4 | |
| 5 | ACL_ARGV *res_a_create(const rfc1035_rr *answer, int n) |
| 6 | { |
| 7 | int i; |
| 8 | struct in_addr sin_addr; |
| 9 | ACL_ARGV *a; |
| 10 | char ip[32]; |
| 11 | |
| 12 | if (n <= 0) |
| 13 | return (NULL); |
| 14 | |
| 15 | a = acl_argv_alloc(n); |
| 16 | |
| 17 | for (i = 0; i < n; i++) { |
| 18 | if (answer[i].type == RFC1035_TYPE_A) { |
| 19 | memcpy(&sin_addr, answer[i].rdata, 4); |
| 20 | ACL_SAFE_STRNCPY(ip, inet_ntoa(sin_addr), sizeof(ip)); |
| 21 | acl_argv_add(a, ip, NULL); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | return (a); |
| 26 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…