network.c:
- undo "fixing" the wrong variable
- fix the logging in receivepacket()