summaryrefslogtreecommitdiff
path: root/lib/sockunion.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2018-03-27 15:13:34 -0400
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-03-27 15:13:34 -0400
commitd7c0a89a3a5697783a6dd89333ab660074790890 (patch)
treeeefa73e502f919b524b8a345437260d4acc23083 /lib/sockunion.c
parent28ac5a038101c66e4275a9b1ef6fb37b4f74fb6a (diff)
*: use C99 standard fixed-width integer types
The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/sockunion.c')
-rw-r--r--lib/sockunion.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/sockunion.c b/lib/sockunion.c
index ab8d8be3e5..28a7f647cb 100644
--- a/lib/sockunion.c
+++ b/lib/sockunion.c
@@ -486,18 +486,18 @@ size_t sockunion_get_addrlen(const union sockunion *su)
return family2addrsize(sockunion_family(su));
}
-const u_char *sockunion_get_addr(const union sockunion *su)
+const uint8_t *sockunion_get_addr(const union sockunion *su)
{
switch (sockunion_family(su)) {
case AF_INET:
- return (const u_char *)&su->sin.sin_addr.s_addr;
+ return (const uint8_t *)&su->sin.sin_addr.s_addr;
case AF_INET6:
- return (const u_char *)&su->sin6.sin6_addr;
+ return (const uint8_t *)&su->sin6.sin6_addr;
}
return NULL;
}
-void sockunion_set(union sockunion *su, int family, const u_char *addr,
+void sockunion_set(union sockunion *su, int family, const uint8_t *addr,
size_t bytes)
{
if (family2addrsize(family) != bytes)
@@ -622,10 +622,10 @@ static int in6addr_cmp(const struct in6_addr *addr1,
const struct in6_addr *addr2)
{
unsigned int i;
- const u_char *p1, *p2;
+ const uint8_t *p1, *p2;
- p1 = (const u_char *)addr1;
- p2 = (const u_char *)addr2;
+ p1 = (const uint8_t *)addr1;
+ p2 = (const uint8_t *)addr2;
for (i = 0; i < sizeof(struct in6_addr); i++) {
if (p1[i] > p2[i])