Re: [PATCH] tc: flower: fix port value truncation

2019-05-28 Thread Stephen Hemminger
On Mon, 27 May 2019 23:03:49 +0200 Lukasz Czapnik wrote: > sscanf truncates read port values silently without any error. As sscanf > man says: > (...) sscanf() conform to C89 and C99 and POSIX.1-2001. These standards > do not specify the ERANGE error. > > Replace sscanf with safer get_be16 that

[PATCH] tc: flower: fix port value truncation

2019-05-27 Thread Lukasz Czapnik
sscanf truncates read port values silently without any error. As sscanf man says: (...) sscanf() conform to C89 and C99 and POSIX.1-2001. These standards do not specify the ERANGE error. Replace sscanf with safer get_be16 that returns error when value is out of range. Example: tc filter add dev e