lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 14 Sep 2019 23:51:09 +0900
From:   "Daniel T. Lee" <danieltimlee@...il.com>
To:     Toke Høiland-Jørgensen <toke@...hat.com>
Cc:     Jesper Dangaard Brouer <brouer@...hat.com>,
        "David S . Miller" <davem@...emloft.net>,
        netdev <netdev@...r.kernel.org>
Subject: Re: [v2 3/3] samples: pktgen: allow to specify destination IP range (CIDR)

On Fri, Sep 13, 2019 at 9:37 PM Toke Høiland-Jørgensen <toke@...hat.com> wrote:
>
> Jesper Dangaard Brouer <brouer@...hat.com> writes:
>
> > On Thu, 12 Sep 2019 03:48:07 +0900
> > "Daniel T. Lee" <danieltimlee@...il.com> wrote:
> >
> >> diff --git a/samples/pktgen/pktgen_sample01_simple.sh b/samples/pktgen/pktgen_sample01_simple.sh
> >> index 063ec0998906..08995fa70025 100755
> >> --- a/samples/pktgen/pktgen_sample01_simple.sh
> >> +++ b/samples/pktgen/pktgen_sample01_simple.sh
> >> @@ -22,6 +22,7 @@ fi
> >>  # Example enforce param "-m" for dst_mac
> >>  [ -z "$DST_MAC" ] && usage && err 2 "Must specify -m dst_mac"
> >>  [ -z "$COUNT" ]   && COUNT="100000" # Zero means indefinitely
> >> +[ -n "$DEST_IP" ] && read -r DST_MIN DST_MAX <<< $(parse_addr${IP6} $DEST_IP)
> >
> > The way the function "parse_addr" is called, in case of errors the
> > 'err()' function is called inside, but it will not stop the program
> > flow.  Instead that function will "only" echo the "ERROR", but program
> > flow continues (even-thought 'err()' uses exit $exitcode).
> >
> > Maybe it is not solveable to get the exit/$?/status out? (I've tried
> > different options, but didn't find a way).
>
> `set -o errexit`? :)
>

I've just tested and Toke's solution works great!

It stops when the function gets error.

I'll update it to the next version.
Thanks for the review!

> -Toke

Powered by blists - more mailing lists