Combined the interface set into the datalink_init for all the datalink layers. Changed all the demo programs to use datalink_init instead of specific datalink functions.

This commit is contained in:
skarg
2007-05-25 01:08:42 +00:00
parent 076ee5f3ca
commit 8026dc003b
29 changed files with 123 additions and 295 deletions
+7 -2
View File
@@ -170,8 +170,13 @@ static int get_local_hwaddr(const char *ifname, unsigned char *mac)
bool ethernet_init(char *interface_name)
{
get_local_hwaddr(interface_name, Ethernet_MAC_Address);
eth802_sockfd = ethernet_bind(&eth_addr, interface_name);
if (interface_name) {
get_local_hwaddr(interface_name, Ethernet_MAC_Address);
eth802_sockfd = ethernet_bind(&eth_addr, interface_name);
} else {
get_local_hwaddr("eth0", Ethernet_MAC_Address);
eth802_sockfd = ethernet_bind(&eth_addr, "eth0");
}
return ethernet_valid();
}