| .. | .. |
|---|
| 41 | 41 | [ -z "$DST_MAC" ] && DST_MAC="90:e2:ba:ff:ff:ff" |
|---|
| 42 | 42 | [ -z "$BURST" ] && BURST=1024 |
|---|
| 43 | 43 | [ -z "$COUNT" ] && COUNT="10000000" # Zero means indefinitely |
|---|
| 44 | +if [ -n "$DEST_IP" ]; then |
|---|
| 45 | + validate_addr${IP6} $DEST_IP |
|---|
| 46 | + read -r DST_MIN DST_MAX <<< $(parse_addr${IP6} $DEST_IP) |
|---|
| 47 | +fi |
|---|
| 48 | +if [ -n "$DST_PORT" ]; then |
|---|
| 49 | + read -r UDP_DST_MIN UDP_DST_MAX <<< $(parse_ports $DST_PORT) |
|---|
| 50 | + validate_ports $UDP_DST_MIN $UDP_DST_MAX |
|---|
| 51 | +fi |
|---|
| 44 | 52 | |
|---|
| 45 | 53 | # Base Config |
|---|
| 46 | 54 | DELAY="0" # Zero means max speed |
|---|
| .. | .. |
|---|
| 67 | 75 | |
|---|
| 68 | 76 | # Destination |
|---|
| 69 | 77 | pg_set $dev "dst_mac $DST_MAC" |
|---|
| 70 | | - pg_set $dev "dst$IP6 $DEST_IP" |
|---|
| 78 | + pg_set $dev "dst${IP6}_min $DST_MIN" |
|---|
| 79 | + pg_set $dev "dst${IP6}_max $DST_MAX" |
|---|
| 80 | + |
|---|
| 81 | + if [ -n "$DST_PORT" ]; then |
|---|
| 82 | + # Single destination port or random port range |
|---|
| 83 | + pg_set $dev "flag UDPDST_RND" |
|---|
| 84 | + pg_set $dev "udp_dst_min $UDP_DST_MIN" |
|---|
| 85 | + pg_set $dev "udp_dst_max $UDP_DST_MAX" |
|---|
| 86 | + fi |
|---|
| 71 | 87 | |
|---|
| 72 | 88 | # Inject packet into RX path of stack |
|---|
| 73 | 89 | pg_set $dev "xmit_mode netif_receive" |
|---|