@@ -323,10 +323,6 @@ struct pktgen_dev {
323
323
struct in6_addr max_in6_daddr ;
324
324
struct in6_addr min_in6_saddr ;
325
325
struct in6_addr max_in6_saddr ;
326
- u64 max_in6_h ;
327
- u64 max_in6_l ;
328
- u64 min_in6_h ;
329
- u64 min_in6_l ;
330
326
331
327
/* If we're doing ranges, random or incremental, then this
332
328
* defines the min/max for those ranges.
@@ -1359,59 +1355,6 @@ static ssize_t pktgen_if_write(struct file *file,
1359
1355
sprintf (pg_result , "OK: dst6_max=%s" , buf );
1360
1356
return count ;
1361
1357
}
1362
- if (!strcmp (name , "src6_min" )) {
1363
- len = strn_len (& user_buffer [i ], sizeof (buf ) - 1 );
1364
- if (len < 0 )
1365
- return len ;
1366
-
1367
- pkt_dev -> flags |= F_IPV6 ;
1368
-
1369
- if (copy_from_user (buf , & user_buffer [i ], len ))
1370
- return - EFAULT ;
1371
- buf [len ] = 0 ;
1372
-
1373
- in6_pton (buf , -1 , pkt_dev -> min_in6_saddr .s6_addr , -1 , NULL );
1374
- snprintf (buf , sizeof (buf ), "%pI6c" , & pkt_dev -> min_in6_saddr );
1375
-
1376
- memcpy (& pkt_dev -> min_in6_h , pkt_dev -> min_in6_saddr .s6_addr , 8 );
1377
- memcpy (& pkt_dev -> min_in6_l , pkt_dev -> min_in6_saddr .s6_addr + 8 , 8 );
1378
- pkt_dev -> min_in6_h = be64_to_cpu (pkt_dev -> min_in6_h );
1379
- pkt_dev -> min_in6_l = be64_to_cpu (pkt_dev -> min_in6_l );
1380
-
1381
- pkt_dev -> cur_in6_saddr = pkt_dev -> min_in6_saddr ;
1382
- if (debug )
1383
- pr_debug ("src6_min set to: %s\n" , buf );
1384
-
1385
- i += len ;
1386
- sprintf (pg_result , "OK: src6_min=%s" , buf );
1387
- return count ;
1388
- }
1389
- if (!strcmp (name , "src6_max" )) {
1390
- len = strn_len (& user_buffer [i ], sizeof (buf ) - 1 );
1391
- if (len < 0 )
1392
- return len ;
1393
-
1394
- pkt_dev -> flags |= F_IPV6 ;
1395
-
1396
- if (copy_from_user (buf , & user_buffer [i ], len ))
1397
- return - EFAULT ;
1398
- buf [len ] = 0 ;
1399
-
1400
- in6_pton (buf , -1 , pkt_dev -> max_in6_saddr .s6_addr , -1 , NULL );
1401
- snprintf (buf , sizeof (buf ), "%pI6c" , & pkt_dev -> max_in6_saddr );
1402
-
1403
- memcpy (& pkt_dev -> max_in6_h , pkt_dev -> max_in6_saddr .s6_addr , 8 );
1404
- memcpy (& pkt_dev -> max_in6_l , pkt_dev -> max_in6_saddr .s6_addr + 8 , 8 );
1405
- pkt_dev -> max_in6_h = be64_to_cpu (pkt_dev -> max_in6_h );
1406
- pkt_dev -> max_in6_l = be64_to_cpu (pkt_dev -> max_in6_l );
1407
-
1408
- if (debug )
1409
- pr_debug ("src6_max set to: %s\n" , buf );
1410
-
1411
- i += len ;
1412
- sprintf (pg_result , "OK: src6_max=%s" , buf );
1413
- return count ;
1414
- }
1415
1358
if (!strcmp (name , "src6" )) {
1416
1359
len = strn_len (& user_buffer [i ], sizeof (buf ) - 1 );
1417
1360
if (len < 0 )
@@ -2343,45 +2286,6 @@ static void set_cur_queue_map(struct pktgen_dev *pkt_dev)
2343
2286
pkt_dev -> cur_queue_map = pkt_dev -> cur_queue_map % pkt_dev -> odev -> real_num_tx_queues ;
2344
2287
}
2345
2288
2346
- /* generate ipv6 source addr */
2347
- static void set_src_in6_addr (struct pktgen_dev * pkt_dev )
2348
- {
2349
- u64 min6 , max6 , rand , i ;
2350
- struct in6_addr addr6 ;
2351
- __be64 addr_l , * t ;
2352
-
2353
- min6 = pkt_dev -> min_in6_l ;
2354
- max6 = pkt_dev -> max_in6_l ;
2355
-
2356
- /* only generate source address in least significant 64 bits range
2357
- * most significant 64 bits must be equal
2358
- */
2359
- if (pkt_dev -> max_in6_h != pkt_dev -> min_in6_h || min6 >= max6 )
2360
- return ;
2361
-
2362
- addr6 = pkt_dev -> min_in6_saddr ;
2363
- t = (__be64 * )addr6 .s6_addr + 1 ;
2364
-
2365
- if (pkt_dev -> flags & F_IPSRC_RND ) {
2366
- do {
2367
- prandom_bytes (& rand , sizeof (rand ));
2368
- rand = rand % (max6 - min6 ) + min6 ;
2369
- addr_l = cpu_to_be64 (rand );
2370
- memcpy (t , & addr_l , 8 );
2371
- } while (ipv6_addr_loopback (& addr6 ) ||
2372
- ipv6_addr_v4mapped (& addr6 ) ||
2373
- ipv6_addr_is_multicast (& addr6 ));
2374
- } else {
2375
- addr6 = pkt_dev -> cur_in6_saddr ;
2376
- i = be64_to_cpu (* t );
2377
- if (++ i > max6 )
2378
- i = min6 ;
2379
- addr_l = cpu_to_be64 (i );
2380
- memcpy (t , & addr_l , 8 );
2381
- }
2382
- pkt_dev -> cur_in6_saddr = addr6 ;
2383
- }
2384
-
2385
2289
/* Increment/randomize headers according to flags and current values
2386
2290
* for IP src/dest, UDP src/dst port, MAC-Addr src/dst
2387
2291
*/
@@ -2550,8 +2454,6 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
2550
2454
}
2551
2455
} else { /* IPV6 * */
2552
2456
2553
- set_src_in6_addr (pkt_dev );
2554
-
2555
2457
if (!ipv6_addr_any (& pkt_dev -> min_in6_daddr )) {
2556
2458
int i ;
2557
2459
0 commit comments