| 277 | } |
| 278 | |
| 279 | static void |
| 280 | shuffle_rt_4(struct rt_rule_4 *rt, int n) |
| 281 | { |
| 282 | struct rt_rule_4 tmp; |
| 283 | int i, j; |
| 284 | |
| 285 | for (i = 0; i < n; i++) { |
| 286 | j = rte_rand() % n; |
| 287 | tmp.addr = rt[i].addr; |
| 288 | tmp.depth = rt[i].depth; |
| 289 | tmp.nh = rt[i].nh; |
| 290 | |
| 291 | rt[i].addr = rt[j].addr; |
| 292 | rt[i].depth = rt[j].depth; |
| 293 | rt[i].nh = rt[j].nh; |
| 294 | |
| 295 | rt[j].addr = tmp.addr; |
| 296 | rt[j].depth = tmp.depth; |
| 297 | rt[j].nh = tmp.nh; |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | static void |
| 302 | shuffle_rt_6(struct rt_rule_6 *rt, int n) |