[BusyBox 0001076]: "ip addr del" does not work

Bernhard Fischer rep.nop at aon.at
Thu Oct 26 09:51:13 UTC 2006


On Wed, Oct 25, 2006 at 10:01:04PM -0500, Jason Schoon wrote:
>On 10/25/06, Denis Vlasenko <vda.linux at googlemail.com> wrote:
>>
>>On Wednesday 25 October 2006 18:06, Bernhard Fischer wrote:
>>> >----------------------------------------------------------------------
>>> > Andreas Winter - 10-25-06 03:26
>>> >----------------------------------------------------------------------
>>> >To be more precise: del should work in addition to delete
>>> >
>>> >----------------------------------------------------------------------
>>> > bernhardf - 10-25-06 09:01
>>> >----------------------------------------------------------------------
>>> >I disagree. ip addr delete should still be supported, so you cannot
>>simply
>>> >change "delete" to "del" there.
>>> >
>>> >The attached snippet uses strncmp(,key,strlen(key)) rather than strcmp.
>>> >This does not catch ambiguous args when you compare the string_array.
>>> >
>>> >For this to work, we'd need to keep track on how many matches we got
>>and
>>> >bail if matches > 1.
>>> >
>>> >For the ip applet, the strncmp thing should do it for now, though.
>>>
>>> What do you think about keeping track of the number of matches to catch
>>> if we've seen ambiguous matches in compare_string_array?
>>
>>int do_ipaddr(int argc, char **argv)
>>{
>>        static const char *const commands[] = {
>>                "add", "delete", "list", "show", "lst", "flush", 0
>>        };
>>
>>I think adding "del" here will be perfectly ok.
>>(do_iproute has "del" and "delete, for example).
>>
>>I am committing this change.
>>
>>Thank you guys.
>>--
>>vda
>>
>
>The reason this initially led to more discussion is that there were numerous
>short aliases supported in the full version, and possibly other applets as
>well.  The thought was to find a way to more generically support them
>without needing to increase the size of applets by adding every possible
>alias variation as a string.

That's why i (still) propose to use strncmp.. :)



More information about the busybox mailing list