|
@@ -103,6 +103,12 @@ static int exe_cmd(char *cmd, node_t *nd)
|
|
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
+static void nic_restart(char *nic)
|
|
|
|
|
+{
|
|
|
|
|
+ char tmp[100];
|
|
|
|
|
+ sprintf(tmp, "ifdown %s;ifup %s;", nic, nic);
|
|
|
|
|
+ system(tmp);
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
int sys_reboot(void)
|
|
int sys_reboot(void)
|
|
@@ -829,8 +835,9 @@ int sys_set_net(NetworkInfo_t *para, int ipVersion)
|
|
|
//system("ip addr flush dev eth0");
|
|
//system("ip addr flush dev eth0");
|
|
|
//sprintf(eth0, "ip link set dev eth0 %s/%d && ip link set eth0 up && ip link set eth0 down", info->ip_address, info->netmask);
|
|
//sprintf(eth0, "ip link set dev eth0 %s/%d && ip link set eth0 up && ip link set eth0 down", info->ip_address, info->netmask);
|
|
|
//system(eth0);
|
|
//system(eth0);
|
|
|
- system("ifdown eth0; ifup eth0");
|
|
|
|
|
- exit(0);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ sys_reboot();
|
|
|
|
|
+ //nic_restart(DFLT_NIC); exit(0);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
@@ -1207,6 +1214,7 @@ int sys_init(void)
|
|
|
lock_s_init();
|
|
lock_s_init();
|
|
|
paras_init();
|
|
paras_init();
|
|
|
|
|
|
|
|
|
|
+ nic_restart(DFLT_NIC);
|
|
|
thread_start(THREAD_ID_POLLING, NULL);
|
|
thread_start(THREAD_ID_POLLING, NULL);
|
|
|
|
|
|
|
|
return 0;
|
|
return 0;
|