Ticket #13303: 999-netifd_route_fix.patch

File 999-netifd_route_fix.patch, 665 bytes (added by xinglp <xinglp@…>, 5 years ago)
  • netifd-2013-04-05

    diff -Naurz netifd-2013-04-05.0/interface-ip.c netifd-2013-04-05/interface-ip.c
    old new  
    287287static int 
    288288route_cmp(const void *k1, const void *k2, void *ptr) 
    289289{ 
    290         const struct device_route *r1 = k1, *r2 = k2; 
    291  
    292         if (r1->mask != r2->mask); 
    293                 return r2->mask - r1->mask; 
    294  
    295         if (r1->metric != r2->metric); 
    296                 return r1->metric - r2->metric; 
    297  
    298         if (r1->flags != r2->flags) 
    299                 return r2->flags - r1->flags; 
    300  
    301         return memcmp(&r1->addr, &r2->addr, sizeof(r1->addr)); 
     290        return memcmp(k1, k2, sizeof(struct device_route) - 
     291                                offsetof(struct device_route, flags)); 
    302292} 
    303293 
    304294static int