diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-09-04 09:27:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-09-04 09:27:09 +0000 |
commit | 1b3eac6c9237c6c12222e450d1c1a57b694cd513 (patch) | |
tree | 60b31928c005874cc41b95d242aa3b9e8400171a /src/iaddr.c | |
parent | Releasing debian version 2.1.3-2. (diff) | |
download | dnscap-1b3eac6c9237c6c12222e450d1c1a57b694cd513.tar.xz dnscap-1b3eac6c9237c6c12222e450d1c1a57b694cd513.zip |
Merging upstream version 2.2.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/iaddr.c')
-rw-r--r-- | src/iaddr.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/iaddr.c b/src/iaddr.c index 43f0b8f..bbe47be 100644 --- a/src/iaddr.c +++ b/src/iaddr.c @@ -66,3 +66,16 @@ int ia_equal(iaddr x, iaddr y) } return FALSE; } + +int ia_equalp(iaddr* x, iaddr* y) +{ + if (x->af != y->af) + return FALSE; + switch (x->af) { + case AF_INET: + return (x->u.a4.s_addr == y->u.a4.s_addr); + case AF_INET6: + return (memcmp(&x->u.a6.s6_addr, &y->u.a6.s6_addr, sizeof(x->u.a6.s6_addr)) == 0); + } + return FALSE; +} |