mkaddr c code
There is another version of mkaddr.c subroutine which is using inet_addr. The problem with inet_addr(3) is that it returns the value INADDR_NONE when an address is invalid. When the IP address 255.255.255.255 is converted to a 32-bit value, its return value is identical to the constant INADDR_NONE.
Consequently, it becomes impossible to distinguish between a bad input IP address, and the general broadcast address. Use of the inet_aton(3) function avoids this ambiguity.
As written, has potential memory leaks: error returns do not call free(inp_addr)ReplyDelete
Yes, you are correct. We will update the code soon. You can also post the suggest fix we will add your changes too.Delete
I keep getting "Undefined reference to mkaddr" when I try to compile this. What am I doing wrong?ReplyDelete
This comment has been removed by the author.Delete
kya bola tu?Delete
Can you show us the code that you are using ? Seems you have missed to add the function.ReplyDelete