]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - samples/pktgen/pktgen_sample01_simple.sh
samples: Add an IPv6 '-6' option to the pktgen scripts
[mirror_ubuntu-bionic-kernel.git] / samples / pktgen / pktgen_sample01_simple.sh
index 8c9d318c221b47a6f4157336fa682dcda7e182d6..29ef4ba507963e5d185bebe94af879f8ed831962 100755 (executable)
@@ -14,7 +14,9 @@ root_check_run_with_sudo "$@"
 source ${basedir}/parameters.sh
 #
 # Set some default params, if they didn't get set
-[ -z "$DEST_IP" ] && DEST_IP="198.18.0.42"
+if [ -z "$DEST_IP" ]; then
+    [ -z "$IP6" ] && DEST_IP="198.18.0.42" || DEST_IP="FD00::1"
+fi
 [ -z "$CLONE_SKB" ] && CLONE_SKB="0"
 # Example enforce param "-m" for dst_mac
 [ -z "$DST_MAC" ] && usage && err 2 "Must specify -m dst_mac"
@@ -54,7 +56,7 @@ pg_set $DEV "flag NO_TIMESTAMP"
 
 # Destination
 pg_set $DEV "dst_mac $DST_MAC"
-pg_set $DEV "dst $DEST_IP"
+pg_set $DEV "dst$IP6 $DEST_IP"
 
 # Setup random UDP port src range
 pg_set $DEV "flag UDPSRC_RND"