Author: marek Date: 2010-03-10 23:34:49 +0100 (Wed, 10 Mar 2010) New Revision: 1593
Modified: branches/batctl-0.2.x/bat-hosts.c Log: batctl: don't warn when identical bat-host entries are found
Signed-off-by: Marek Lindner lindner_marek@yahoo.de
Modified: branches/batctl-0.2.x/bat-hosts.c =================================================================== --- branches/batctl-0.2.x/bat-hosts.c 2010-03-10 22:34:46 UTC (rev 1592) +++ branches/batctl-0.2.x/bat-hosts.c 2010-03-10 22:34:49 UTC (rev 1593) @@ -98,6 +98,10 @@
/* mac entry already exists - we found a new name for it */ if (bat_host) { + /* if the mac addresses and the names are the same we can safely ignore the entry */ + if (strcmp(bat_host->name, name) == 0) + continue; + fprintf(stderr, "Warning - mac already known (changing name from '%s' to '%s'): %s\n", bat_host->name, name, mac_str); strncpy(bat_host->name, name, HOST_NAME_MAX_LEN - 1);