Robert Murrell
|
How to programmatically set the net mask of an IP alias
|
Robert Murrell
01/18/2011 3:49 PM
post82459
|
How to programmatically set the net mask of an IP alias
I am adding an IP alias to en0 using ioctl SIOCAIFADDR function in my application. This works OK. Next, I try to set
the subnet mask using ioctl SIOCSIFNETMASK, but this changes the network mask of the primary IP address. I tried to
'bind' the alias address to the socket before calling ioctl but this didn't work. How do I set the subnet mask (and
broadcast address) for an IP alias?
|
|
|