pedrorigon / wakeUP_Computer

This project was undertaken as a criterion for evaluation in the subject of Operating Systems 2 at UFRGS. The objective of the work is to implement a "sleep management" service for workstations that belong to the same physical network segment of a large organization.
3 stars 1 forks source link

Change discovery packet destination from INADDR_BROADCAST to actual addresses #1

Closed phckopper closed 1 year ago

phckopper commented 1 year ago

We should find an alternative for using INADDR_BROADCAST as it doesn't send a packet to all interface, only to the highest priority one.

https://github.com/pedrorigon/wakeUP_Computer/blob/6ac0ad6d3572658420c3e4607254817d81365dc4/discovery_service.c#L25

See: https://stackoverflow.com/questions/683624/udp-broadcast-on-all-interfaces

phckopper commented 1 year ago

For instance, when running on the UFRGS network the packet gets sent to the whole network

Screenshot_20230119_151152

This is undesirable as we might want to sent packets to a specific interface, for instance the loopback one, in order to test our application.

pedrorigon commented 1 year ago

I assume that it would facilitate the execution of program tests (127.0.0.1): Fact, at the moment I was performing tests on my laptop that was on the same network as my desktop computer. If possible, we can make this change, but I believe that at work this is the command that we should use, or not?