- set_ip_source_policy(true, v6, IPRULE_PRIORITY_ADDR, &a_new->addr,
- (v6) ? 128 : 32, iface, NULL, NULL);
- set_ip_source_policy(true, v6, IPRULE_PRIORITY_NW, &a_new->addr,
- a_new->mask, iface, NULL, NULL);
+ set_ip_source_policy(true, v6, IPRULE_PRIORITY_ADDR, &a_new->addr,
+ (v6) ? 128 : 32, iface, NULL, NULL);
+ set_ip_source_policy(true, v6, IPRULE_PRIORITY_NW, &a_new->addr,
+ a_new->mask, iface, NULL, NULL);
+ }
if ((a_new->flags & DEVADDR_OFFLINK) || iface->metric)
interface_handle_subnet_route(iface, a_new, true);
if ((a_new->flags & DEVADDR_OFFLINK) || iface->metric)
interface_handle_subnet_route(iface, a_new, true);
struct device_prefix_assignment *c;
list_for_each_entry(c, list, head) {
if (assign->assigned != -1) {
struct device_prefix_assignment *c;
list_for_each_entry(c, list, head) {
if (assign->assigned != -1) {
netifd_log_message(L_WARNING, "Failed to assign requested subprefix "
"of size %hhu for %s, trying other\n", c->length, c->name);
}
netifd_log_message(L_WARNING, "Failed to assign requested subprefix "
"of size %hhu for %s, trying other\n", c->length, c->name);
}
- list_add_tail(&c->head, &assign_later);
+
+ struct list_head *next = &assign_later;
+ struct device_prefix_assignment *n;
+ list_for_each_entry(n, &assign_later, head) {
+ if (n->length < c->length) {
+ next = &n->head;
+ break;
+ }
+ }
+ list_add_tail(&c->head, next);