mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
Fixed ifconfig for Darwin
This commit is contained in:
parent
70d3acf9af
commit
7621bdfc77
@ -125,13 +125,17 @@ void
|
||||
ifconf(const char *tundev, const char *ipaddr)
|
||||
{
|
||||
#ifdef linux
|
||||
ssystem("ifconfig %s inet `hostname` up", tundev);
|
||||
ssystem("ifconfig %s inet6 `hostname` up", tundev);
|
||||
ssystem("ifconfig %s add %s", tundev, ipaddr);
|
||||
#elif defined(__MACH__)
|
||||
ssystem("ifconfig %s inet6 %s up", tundev, ipaddr);
|
||||
ssystem("sysctl -w net.inet.ip.forwarding=1");
|
||||
#else
|
||||
ssystem("ifconfig %s inet `hostname` %s up", tundev, ipaddr);
|
||||
ssystem("ifconfig %s inet6 `hostname` %s up", tundev, ipaddr);
|
||||
ssystem("sysctl -w net.inet.ip.forwarding=1");
|
||||
#endif /* !linux */
|
||||
|
||||
/* Print the configuration to the console. */
|
||||
ssystem("ifconfig %s\n", tundev);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
Loading…
Reference in New Issue
Block a user