[lldp-devel] [PATCH] evb lower case comparision for EVB protocol parameters

Thomas-Mich Richter tmricht at linux.vnet.ibm.com
Wed Mar 6 08:23:57 UTC 2013


On 03/05/2013 08:55 AM, John Fastabend wrote:
> On 03/04/2013 06:55 AM, Thomas Richter wrote:
>> The lldpad configuration file may store IEEE 802.1 Qbg parameters
>> (such as fmode and capabilities) in upper case letters.
>> When reading the confuration file the values a compared
>> against lower case strings and do not match.
>> The patch reads the configuration file values and converts
>> them to lowercase before the comparison.
>>
>> Signed-off-by: Thomas Richter <tmricht at linux.vnet.ibm.com>
>> ---
> 
> Would it be more convenient to use case case insensitive
> operations strcasestr for example? Also why don't we just
> write the strings in the case we expect them in?
> 

Thanks very much for the pointer to strcasestr() functions
This does the job nicely. Never heard of it before.

Sure the functions to save the data in the configuration
file can convert to lower case before saving.
But when someone manually edits the file and uses upper
case, we hit the same problem. Using strcasestr()
instead of strstr() fixes this too and is no big deal.

I will send a revised patch today.

-- 
Thomas Richter, Dept 3250, IBM LTC Boeblingen, Data Center Networking
--
Vorsitzende des Aufsichtsrats: Martina Koederitz 
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294



More information about the lldp-devel mailing list