Commit 33462073 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Rename v4ov6 to v4viav6 in source code.

parent a09b114c
...@@ -63,7 +63,7 @@ int debug = 0; ...@@ -63,7 +63,7 @@ int debug = 0;
int link_detect = 0; int link_detect = 0;
int all_wireless = 0; int all_wireless = 0;
int has_ipv6_subtrees = 0; int has_ipv6_subtrees = 0;
int has_v4ov6 = 0; int has_v4viav6 = 0;
int default_wireless_hello_interval = -1; int default_wireless_hello_interval = -1;
int default_wired_hello_interval = -1; int default_wired_hello_interval = -1;
int resend_delay = -1; int resend_delay = -1;
...@@ -152,7 +152,7 @@ main(int argc, char **argv) ...@@ -152,7 +152,7 @@ main(int argc, char **argv)
protocol_port = 6696; protocol_port = 6696;
change_smoothing_half_life(4); change_smoothing_half_life(4);
has_ipv6_subtrees = kernel_has_ipv6_subtrees(); has_ipv6_subtrees = kernel_has_ipv6_subtrees();
has_v4ov6 = kernel_has_v4ov6(); has_v4viav6 = kernel_has_v4viav6();
while(1) { while(1) {
opt = getopt(argc, argv, opt = getopt(argc, argv,
......
...@@ -92,7 +92,7 @@ extern const char *logfile, *pidfile, *state_file; ...@@ -92,7 +92,7 @@ extern const char *logfile, *pidfile, *state_file;
extern int link_detect; extern int link_detect;
extern int all_wireless; extern int all_wireless;
extern int has_ipv6_subtrees; extern int has_ipv6_subtrees;
extern int has_v4ov6; extern int has_v4viav6;
extern unsigned char myid[8]; extern unsigned char myid[8];
extern int have_id; extern int have_id;
......
...@@ -1047,7 +1047,7 @@ parse_option(int c, gnc_t gnc, void *closure, char *token) ...@@ -1047,7 +1047,7 @@ parse_option(int c, gnc_t gnc, void *closure, char *token)
else if(strcmp(token, "ipv6-subtrees") == 0) else if(strcmp(token, "ipv6-subtrees") == 0)
has_ipv6_subtrees = b; has_ipv6_subtrees = b;
else if(strcmp(token, "v4-over-v6") == 0) else if(strcmp(token, "v4-over-v6") == 0)
has_v4ov6 = b; has_v4viav6 = b;
else if(strcmp(token, "reflect-kernel-metric") == 0) else if(strcmp(token, "reflect-kernel-metric") == 0)
reflect_kernel_metric = b; reflect_kernel_metric = b;
else else
......
...@@ -95,7 +95,7 @@ int gettime(struct timeval *tv); ...@@ -95,7 +95,7 @@ int gettime(struct timeval *tv);
int read_random_bytes(void *buf, int len); int read_random_bytes(void *buf, int len);
int kernel_older_than(const char *sysname, int version, int sub_version); int kernel_older_than(const char *sysname, int version, int sub_version);
int kernel_has_ipv6_subtrees(void); int kernel_has_ipv6_subtrees(void);
int kernel_has_v4ov6(void); int kernel_has_v4viav6(void);
int add_rule(int prio, const unsigned char *src_prefix, int src_plen, int add_rule(int prio, const unsigned char *src_prefix, int src_plen,
int table); int table);
int flush_rule(int prio, int family); int flush_rule(int prio, int family);
......
...@@ -944,9 +944,9 @@ kernel_has_ipv6_subtrees(void) ...@@ -944,9 +944,9 @@ kernel_has_ipv6_subtrees(void)
} }
int int
kernel_has_v4ov6(void) kernel_has_v4viav6(void)
{ {
/* v4-over-v6 was introduced in Linux by commit /* v4-via-v6 was introduced in Linux by commit
d15662682db232da77136cd348f4c9df312ca6f9 first released as 5.2 */ d15662682db232da77136cd348f4c9df312ca6f9 first released as 5.2 */
return (kernel_older_than("Linux", 5, 2) == 0); return (kernel_older_than("Linux", 5, 2) == 0);
} }
......
...@@ -396,7 +396,7 @@ kernel_has_ipv6_subtrees(void) ...@@ -396,7 +396,7 @@ kernel_has_ipv6_subtrees(void)
} }
int int
kernel_has_v4ov6(void) kernel_has_v4viav6(void)
{ {
return 0; return 0;
} }
......
...@@ -56,7 +56,7 @@ struct timeval seqno_time = {0, 0}; ...@@ -56,7 +56,7 @@ struct timeval seqno_time = {0, 0};
static int static int
known_ae(int ae) known_ae(int ae)
{ {
return ae <= AE_IPV6_LOCAL || ae == AE_V4OV6; return ae <= AE_IPV6_LOCAL || ae == AE_V4VIAV6;
} }
/* Parse a network prefix, encoded in the somewhat baroque compressed /* Parse a network prefix, encoded in the somewhat baroque compressed
...@@ -87,7 +87,7 @@ network_prefix(int ae, int plen, unsigned int omitted, ...@@ -87,7 +87,7 @@ network_prefix(int ae, int plen, unsigned int omitted,
ret = 0; ret = 0;
break; break;
case AE_IPV4: case AE_IPV4:
case AE_V4OV6: case AE_V4VIAV6:
if(omitted > 4 || pb > 4 || (pb > omitted && len < pb - omitted)) if(omitted > 4 || pb > 4 || (pb > omitted && len < pb - omitted))
return -1; return -1;
memcpy(prefix, v4prefix, 12); memcpy(prefix, v4prefix, 12);
...@@ -593,10 +593,10 @@ parse_packet(const unsigned char *from, struct interface *ifp, ...@@ -593,10 +593,10 @@ parse_packet(const unsigned char *from, struct interface *ifp,
int bodylen; int bodylen;
struct neighbour *neigh = NULL; struct neighbour *neigh = NULL;
int have_router_id = 0, have_v4_prefix = 0, have_v6_prefix = 0, int have_router_id = 0, have_v4_prefix = 0, have_v6_prefix = 0,
have_v4ov6_prefix = 0, have_v4viav6_prefix = 0,
have_v4_nh = 0, have_v6_nh = 0; have_v4_nh = 0, have_v6_nh = 0;
unsigned char router_id[8], v4_prefix[16], v6_prefix[16], unsigned char router_id[8], v4_prefix[16], v6_prefix[16],
v4ov6_prefix[16], v4_nh[16], v6_nh[16]; v4viav6_prefix[16], v4_nh[16], v6_nh[16];
int have_hello_rtt = 0; int have_hello_rtt = 0;
/* Content of the RTT sub-TLV on IHU messages. */ /* Content of the RTT sub-TLV on IHU messages. */
unsigned int hello_send_us = 0, hello_rtt_receive_time = 0; unsigned int hello_send_us = 0, hello_rtt_receive_time = 0;
...@@ -814,7 +814,7 @@ parse_packet(const unsigned char *from, struct interface *ifp, ...@@ -814,7 +814,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
memcpy(v6_nh, nh, 16); memcpy(v6_nh, nh, 16);
have_v6_nh = 1; have_v6_nh = 1;
break; break;
case AE_V4OV6: case AE_V4VIAV6:
goto done; goto done;
default: default:
/* We should have guards against this before this point. */ /* We should have guards against this before this point. */
...@@ -832,7 +832,7 @@ parse_packet(const unsigned char *from, struct interface *ifp, ...@@ -832,7 +832,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
int rc, parsed_len, is_ss; int rc, parsed_len, is_ss;
if(len < 10) { if(len < 10) {
if(len < 2 || message[3] & 0x80) if(len < 2 || message[3] & 0x80)
have_v4_prefix = have_v6_prefix = have_v4ov6_prefix = 0; have_v4_prefix = have_v6_prefix = have_v4viav6_prefix = 0;
goto fail; goto fail;
} }
if(!known_ae(message[2])) { if(!known_ae(message[2])) {
...@@ -840,11 +840,11 @@ parse_packet(const unsigned char *from, struct interface *ifp, ...@@ -840,11 +840,11 @@ parse_packet(const unsigned char *from, struct interface *ifp,
message[2]); message[2]);
goto done; goto done;
} }
if(message[2] == AE_V4OV6 && !has_v4ov6) { if(message[2] == AE_V4VIAV6 && !has_v4viav6) {
/* We can safely ignore the prefix update that might come /* We can safely ignore the prefix update that might come
alongside with this TLV, since we ignore every v4-over-v6 alongside with this TLV, since we ignore every v4-via-v6
TLVs */ TLVs */
debugf("Ignoring v4-over-v6 route (unsupported).\n"); debugf("Ignoring v4-via-v6 route (unsupported).\n");
goto done; goto done;
} }
DO_NTOHS(interval, message + 6); DO_NTOHS(interval, message + 6);
...@@ -853,13 +853,13 @@ parse_packet(const unsigned char *from, struct interface *ifp, ...@@ -853,13 +853,13 @@ parse_packet(const unsigned char *from, struct interface *ifp,
if(message[5] == 0 || if(message[5] == 0 ||
(message[2] == AE_IPV4 ? have_v4_prefix : (message[2] == AE_IPV4 ? have_v4_prefix :
message[2] == AE_IPV6 ? have_v6_prefix : message[2] == AE_IPV6 ? have_v6_prefix :
message[2] == AE_V4OV6 ? have_v4ov6_prefix : message[2] == AE_V4VIAV6 ? have_v4viav6_prefix :
0)) 0))
rc = network_prefix(message[2], message[4], message[5], rc = network_prefix(message[2], message[4], message[5],
message + 12, message + 12,
(message[2] == AE_IPV4 ? v4_prefix : (message[2] == AE_IPV4 ? v4_prefix :
message[2] == AE_IPV6 ? v6_prefix : message[2] == AE_IPV6 ? v6_prefix :
message[2] == AE_V4OV6 ? v4ov6_prefix : message[2] == AE_V4VIAV6 ? v4viav6_prefix :
NULL), NULL),
len - 10, prefix); len - 10, prefix);
else else
...@@ -873,7 +873,7 @@ parse_packet(const unsigned char *from, struct interface *ifp, ...@@ -873,7 +873,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
} }
if(rc < 0) { if(rc < 0) {
if(message[3] & 0x80) if(message[3] & 0x80)
have_v4_prefix = have_v6_prefix = have_v4ov6_prefix = 0; have_v4_prefix = have_v6_prefix = have_v4viav6_prefix = 0;
goto fail; goto fail;
} }
parsed_len = 10 + rc; parsed_len = 10 + rc;
...@@ -890,9 +890,9 @@ parse_packet(const unsigned char *from, struct interface *ifp, ...@@ -890,9 +890,9 @@ parse_packet(const unsigned char *from, struct interface *ifp,
memcpy(v6_prefix, prefix, 16); memcpy(v6_prefix, prefix, 16);
have_v6_prefix = 1; have_v6_prefix = 1;
break; break;
case AE_V4OV6: case AE_V4VIAV6:
memcpy(v4ov6_prefix, prefix, 16); memcpy(v4viav6_prefix, prefix, 16);
have_v4ov6_prefix = 1; have_v4viav6_prefix = 1;
break; break;
default: default:
debugf("Received default prefix update with invalid " debugf("Received default prefix update with invalid "
...@@ -1461,7 +1461,7 @@ really_buffer_update(struct buffered *buf, struct interface *ifp, ...@@ -1461,7 +1461,7 @@ really_buffer_update(struct buffered *buf, struct interface *ifp,
if(v4) { if(v4) {
if(!ifp->ipv4) { if(!ifp->ipv4) {
ae = AE_V4OV6; ae = AE_V4VIAV6;
} else { } else {
ae = AE_IPV4; ae = AE_IPV4;
if(!buf->have_nh || if(!buf->have_nh ||
......
...@@ -52,7 +52,7 @@ THE SOFTWARE. ...@@ -52,7 +52,7 @@ THE SOFTWARE.
#define AE_IPV4 1 #define AE_IPV4 1
#define AE_IPV6 2 #define AE_IPV6 2
#define AE_IPV6_LOCAL 3 #define AE_IPV6_LOCAL 3
#define AE_V4OV6 4 #define AE_V4VIAV6 4
extern unsigned short myseqno; extern unsigned short myseqno;
extern struct timeval seqno_time; extern struct timeval seqno_time;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment