diff options
Diffstat (limited to 'src/tun/regex.c')
-rw-r--r-- | src/tun/regex.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tun/regex.c b/src/tun/regex.c index 61d0b3e18..87e75b511 100644 --- a/src/tun/regex.c +++ b/src/tun/regex.c | |||
@@ -40,13 +40,13 @@ static void | |||
40 | iptobinstr (const int af, const void *addr, char *str) | 40 | iptobinstr (const int af, const void *addr, char *str) |
41 | { | 41 | { |
42 | int i; | 42 | int i; |
43 | 43 | ||
44 | switch (af) | 44 | switch (af) |
45 | { | 45 | { |
46 | case AF_INET: | 46 | case AF_INET: |
47 | { | 47 | { |
48 | uint32_t b = htonl (((struct in_addr *) addr)->s_addr); | 48 | uint32_t b = htonl (((struct in_addr *) addr)->s_addr); |
49 | 49 | ||
50 | str[32] = '\0'; | 50 | str[32] = '\0'; |
51 | str += 31; | 51 | str += 31; |
52 | for (i = 31; i >= 0; i--) | 52 | for (i = 31; i >= 0; i--) |
@@ -60,7 +60,7 @@ iptobinstr (const int af, const void *addr, char *str) | |||
60 | case AF_INET6: | 60 | case AF_INET6: |
61 | { | 61 | { |
62 | struct in6_addr b = *(const struct in6_addr *) addr; | 62 | struct in6_addr b = *(const struct in6_addr *) addr; |
63 | 63 | ||
64 | str[128] = '\0'; | 64 | str[128] = '\0'; |
65 | str += 127; | 65 | str += 127; |
66 | for (i = 127; i >= 0; i--) | 66 | for (i = 127; i >= 0; i--) |
@@ -88,7 +88,7 @@ ipv4netmasktoprefixlen (const char *netmask) | |||
88 | struct in_addr a; | 88 | struct in_addr a; |
89 | unsigned int len; | 89 | unsigned int len; |
90 | uint32_t t; | 90 | uint32_t t; |
91 | 91 | ||
92 | if (1 != inet_pton (AF_INET, netmask, &a)) | 92 | if (1 != inet_pton (AF_INET, netmask, &a)) |
93 | return 0; | 93 | return 0; |
94 | len = 32; | 94 | len = 32; |
@@ -111,7 +111,7 @@ GNUNET_TUN_ipv4toregexsearch (const struct in_addr *ip, const char *netmask, | |||
111 | char *rxstr) | 111 | char *rxstr) |
112 | { | 112 | { |
113 | unsigned int pfxlen; | 113 | unsigned int pfxlen; |
114 | 114 | ||
115 | pfxlen = ipv4netmasktoprefixlen (netmask); | 115 | pfxlen = ipv4netmasktoprefixlen (netmask); |
116 | iptobinstr (AF_INET, ip, rxstr); | 116 | iptobinstr (AF_INET, ip, rxstr); |
117 | rxstr[pfxlen] = '\0'; | 117 | rxstr[pfxlen] = '\0'; |