Added return code to setipaddress and removed fprintfs

Added return code to setipaddress and removed fprintfs