alfred: Keep order of interfaces from commandline

Message ID 20161013090310.9619-1-sven.eckelmann@open-mesh.com (mailing list archive)
State Accepted, archived
Commit f21f747182c3fc970965e903e9ff01791a5e7da8
Delegated to: Simon Wunderlich
Headers

Commit Message

Sven Eckelmann Oct. 13, 2016, 9:03 a.m. UTC
  The first (valid) interface mac address will be used as source mac for an
dataset. But alfred added the commandline parameters for a multi-interface
master in reverse order.

Keep the list in the same order as the commandline to fulfill the
user expectations when checking the source entries of datasets.

Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
---
 netsock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Simon Wunderlich Oct. 14, 2016, 1:33 p.m. UTC | #1
On Thursday, October 13, 2016 11:03:10 AM CEST Sven Eckelmann wrote:
> The first (valid) interface mac address will be used as source mac for an
> dataset. But alfred added the commandline parameters for a multi-interface
> master in reverse order.
> 
> Keep the list in the same order as the commandline to fulfill the
> user expectations when checking the source entries of datasets.
> 
> Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>

Applied in revision f21f747

Thanks!
     Simon
  

Patch

diff --git a/netsock.c b/netsock.c
index d72541e..5d37347 100644
--- a/netsock.c
+++ b/netsock.c
@@ -165,7 +165,7 @@  int netsock_set_interfaces(struct globals *globals, char *interfaces)
 			return -ENOMEM;
 		}
 
-		list_add(&interface->list, &globals->interfaces);
+		list_add_tail(&interface->list, &globals->interfaces);
 	}
 
 	return 0;