| 299 | } |
| 300 | |
| 301 | static void |
| 302 | shuffle_rt_6(struct rt_rule_6 *rt, int n) |
| 303 | { |
| 304 | struct rt_rule_6 tmp; |
| 305 | int i, j; |
| 306 | |
| 307 | for (i = 0; i < n; i++) { |
| 308 | j = rte_rand() % n; |
| 309 | memcpy(tmp.addr, rt[i].addr, 16); |
| 310 | tmp.depth = rt[i].depth; |
| 311 | tmp.nh = rt[i].nh; |
| 312 | |
| 313 | memcpy(rt[i].addr, rt[j].addr, 16); |
| 314 | rt[i].depth = rt[j].depth; |
| 315 | rt[i].nh = rt[j].nh; |
| 316 | |
| 317 | memcpy(rt[j].addr, tmp.addr, 16); |
| 318 | rt[j].depth = tmp.depth; |
| 319 | rt[j].nh = tmp.nh; |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | static void |
| 324 | gen_random_rt_4(struct rt_rule_4 *rt, int nh_sz) |