switch (route->family) {
case AF_INET:
case AF_INET6:
- siphash24_compress(&route->gw, FAMILY_ADDRESS_SIZE(route->family), state);
- siphash24_compress(&route->dst, FAMILY_ADDRESS_SIZE(route->family), state);
siphash24_compress(&route->dst_prefixlen, sizeof(route->dst_prefixlen), state);
- siphash24_compress(&route->src, FAMILY_ADDRESS_SIZE(route->family), state);
+ siphash24_compress(&route->dst, FAMILY_ADDRESS_SIZE(route->family), state);
+
siphash24_compress(&route->src_prefixlen, sizeof(route->src_prefixlen), state);
+ siphash24_compress(&route->src, FAMILY_ADDRESS_SIZE(route->family), state);
+
+ siphash24_compress(&route->gw, FAMILY_ADDRESS_SIZE(route->family), state);
+
siphash24_compress(&route->prefsrc, FAMILY_ADDRESS_SIZE(route->family), state);
siphash24_compress(&route->tos, sizeof(route->tos), state);
siphash24_compress(&route->protocol, sizeof(route->protocol), state);
siphash24_compress(&route->scope, sizeof(route->scope), state);
siphash24_compress(&route->type, sizeof(route->type), state);
+
siphash24_compress(&route->initcwnd, sizeof(route->initcwnd), state);
siphash24_compress(&route->initrwnd, sizeof(route->initrwnd), state);
if (r != 0)
return r;
+ r = memcmp(&a->dst, &b->dst, FAMILY_ADDRESS_SIZE(a->family));
+ if (r != 0)
+ return r;
+
r = CMP(a->src_prefixlen, b->src_prefixlen);
if (r != 0)
return r;
- r = CMP(a->tos, b->tos);
+ r = memcmp(&a->src, &b->src, FAMILY_ADDRESS_SIZE(a->family));
if (r != 0)
return r;
- r = CMP(a->priority, b->priority);
+ r = memcmp(&a->gw, &b->gw, FAMILY_ADDRESS_SIZE(a->family));
if (r != 0)
return r;
- r = CMP(a->table, b->table);
+ r = memcmp(&a->prefsrc, &b->prefsrc, FAMILY_ADDRESS_SIZE(a->family));
if (r != 0)
return r;
- r = CMP(a->protocol, b->protocol);
+ r = CMP(a->tos, b->tos);
if (r != 0)
return r;
- r = CMP(a->scope, b->scope);
+ r = CMP(a->priority, b->priority);
if (r != 0)
return r;
- r = CMP(a->type, b->type);
+ r = CMP(a->table, b->table);
if (r != 0)
return r;
- r = CMP(a->initcwnd, b->initcwnd);
+ r = CMP(a->protocol, b->protocol);
if (r != 0)
return r;
- r = CMP(a->initrwnd, b->initrwnd);
+ r = CMP(a->scope, b->scope);
if (r != 0)
return r;
- r = memcmp(&a->gw, &b->gw, FAMILY_ADDRESS_SIZE(a->family));
+ r = CMP(a->type, b->type);
if (r != 0)
return r;
- r = memcmp(&a->dst, &b->dst, FAMILY_ADDRESS_SIZE(a->family));
+ r = CMP(a->initcwnd, b->initcwnd);
if (r != 0)
return r;
- r = memcmp(&a->src, &b->src, FAMILY_ADDRESS_SIZE(a->family));
+ r = CMP(a->initrwnd, b->initrwnd);
if (r != 0)
return r;
- return memcmp(&a->prefsrc, &b->prefsrc, FAMILY_ADDRESS_SIZE(a->family));
+ return 0;
default:
/* treat any other address family as AF_UNSPEC */
return 0;
switch (rule->family) {
case AF_INET:
case AF_INET6:
-
siphash24_compress(&rule->from, FAMILY_ADDRESS_SIZE(rule->family), state);
siphash24_compress(&rule->from_prefixlen, sizeof(rule->from_prefixlen), state);
if (r != 0)
return r;
+ r = memcmp(&a->from, &b->from, FAMILY_ADDRESS_SIZE(a->family));
+ if (r != 0)
+ return r;
+
r = CMP(a->to_prefixlen, b->to_prefixlen);
if (r != 0)
return r;
+ r = memcmp(&a->to, &b->to, FAMILY_ADDRESS_SIZE(a->family));
+ if (r != 0)
+ return r;
+
r = CMP(a->invert_rule, b->invert_rule);
if (r != 0)
return r;
if (r != 0)
return r;
- r = strcmp_ptr(a->iif, b->iif);
- if (!r)
- return r;
-
- r = strcmp_ptr(a->oif, b->oif);
- if (!r)
- return r;
-
r = CMP(a->protocol, b->protocol);
if (r != 0)
return r;
if (r != 0)
return r;
- r = memcmp(&a->from, &b->from, FAMILY_ADDRESS_SIZE(a->family));
- if (r != 0)
+ r = strcmp_ptr(a->iif, b->iif);
+ if (!r)
return r;
- return memcmp(&a->to, &b->to, FAMILY_ADDRESS_SIZE(a->family));
+ r = strcmp_ptr(a->oif, b->oif);
+ if (!r)
+ return r;
+ return 0;
default:
/* treat any other address family as AF_UNSPEC */
return 0;