trafgen: reset errno before calling sscanf in str2mac
commit29fb845dfcf988110d01c141fdd490163a6f3714
authorJoachim Nilsson <troglobit@gmail.com>
Mon, 23 Sep 2019 07:45:49 +0000 (23 09:45 +0200)
committerTobias Klauser <tklauser@distanz.ch>
Mon, 23 Sep 2019 08:03:19 +0000 (23 10:03 +0200)
treedb16fe9b750da0932baf34d1dd87dfb66db37c0c
parentc5b1ed4446f1da55f474c3eb5196825b19a08a05
trafgen: reset errno before calling sscanf in str2mac

When testing trafgen with the following example from the man page the
error message "Failed to parse MAC address 11:22:33:44:55:66" is
printed.

  trafgen -o lo --cpus 1 -n 3 '{ eth(da=11:22:33:44:55:66, da[0]=dinc()), tcp() }'

Turns out errno was not cleared before str2mac() called sscanf().

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
str.c