Package: wakeonlan
The wakeonlan binary (all versions of all Debian branches) depends on
the netdata package. Without netdata, the following error shows up:
----------
root@VM-Buster:~# wakeonlan XX:XX:XX:XX:XX:XX
Use of uninitialized value $proto in socket at /usr/bin/wakeonlan line 121.
Use of uninitialized value $port in concatenation (.) or string at
/usr/bin/wakeonlan line 124.
Sending magic packet to 255.255.255.255: with XX:XX:XX:XX:XX:XX
send : Invalid argument at /usr/bin/wakeonlan line 126.
----------
The failing code part of the (perl) script:
----------
15 my $DEFAULT_PORT = getservbyname('discard', 'udp');
...
118 $them = pack_sockaddr_in($port, $raddr);
119 $proto = getprotobyname('udp');
120
121 socket(S, AF_INET, SOCK_DGRAM, $proto) or die "socket : $!";
122 setsockopt(S, SOL_SOCKET, SO_BROADCAST, 1) or die "setsockopt : $!";
123
124 print "Sending magic packet to $ipaddr:$port with $hwaddr\n";
125
126 send(S, $pkt, 0, $them) or die "send : $!";
----------
- If no $port is given, the default "discard" port for UDP is used.
- As no port is given in the output (after 255.255.255.255:), this
obviously fails.
- Deriving $proto fails as well.
getprotobyname() and getprotobyname() depend on files provided by the
netdata package, e.g. /etc/protocols.
The perl package has netdata as recommendation, which might be the
reason why this error is rarely faced: https://packages.debian.org/sid/perl
But since wakeonlan uses perl functions that strictly depend on netdata,
it should depend on it, so it is pulled even when used with
"--no-install-recommends".