* [gentoo-commits] repo/gentoo:master commit in: net-misc/wakeonlan/files/
@ 2021-02-18 23:06 Conrad Kostecki
0 siblings, 0 replies; only message in thread
From: Conrad Kostecki @ 2021-02-18 23:06 UTC (permalink / raw
To: gentoo-commits
commit: c8f73f4f3151055bee572d58fc1e9ccbcb7f4ef7
Author: Michael Mair-Keimberger <mmk <AT> levelnine <DOT> at>
AuthorDate: Thu Feb 18 16:59:47 2021 +0000
Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Thu Feb 18 23:04:35 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c8f73f4f
net-misc/wakeonlan: remove unused patch
Closes: https://github.com/gentoo/gentoo/pull/19523
Package-Manager: Portage-3.0.14, Repoman-3.0.2
Signed-off-by: Michael Mair-Keimberger <mmk <AT> levelnine.at>
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
.../files/wakeonlan-0.41-ethers-lookup.patch | 90 ----------------------
1 file changed, 90 deletions(-)
diff --git a/net-misc/wakeonlan/files/wakeonlan-0.41-ethers-lookup.patch b/net-misc/wakeonlan/files/wakeonlan-0.41-ethers-lookup.patch
deleted file mode 100644
index 6cbc355e285..00000000000
--- a/net-misc/wakeonlan/files/wakeonlan-0.41-ethers-lookup.patch
+++ /dev/null
@@ -1,90 +0,0 @@
---- wakeonlan-0.41.orig/wakeonlan
-+++ wakeonlan-0.41/wakeonlan
-@@ -5,6 +5,7 @@
- #########################################################################
-
- use strict;
-+use Net::hostent;
- use Socket;
- use Getopt::Std;
- use vars qw($VERSION $opt_v $opt_h $opt_i $opt_p $opt_f);
-@@ -44,19 +45,64 @@
-
- sub wake
- {
-- my $hwaddr = shift;
-+ my $host = shift;
- my $ipaddr = shift || $DEFAULT_IP;
- my $port = shift || $DEFAULT_PORT;
-
- my ($raddr, $them, $proto);
-- my ($hwaddr_re, $pkt);
-+ my ($hwaddr, $hwaddr_re, $pkt);
-
-- # Validate hardware address (ethernet address)
-+ # get the hardware address (ethernet address)
-
- $hwaddr_re = join(':', ('[0-9A-Fa-f]{1,2}') x 6);
-- if ($hwaddr !~ m/^$hwaddr_re$/) {
-- warn "Invalid hardware address: $hwaddr\n";
-- return undef;
-+ if ($host =~ m/^$hwaddr_re$/) {
-+ $hwaddr = $host;
-+ } else {
-+ # $host is not a hardware address, try to resolve it
-+ my $ip_re = join('\.', ('([0-9]|[1-9][0-9]|1[0-9]{2}|2([0-4][0-9]|5[0-5]))') x 4);
-+ my $ip_addr;
-+ if ($host =~ m/^$ip_re$/) {
-+ $ip_addr = $host;
-+ } else {
-+ my $h;
-+ unless ($h = gethost($host)) {
-+ warn "$host is not a hardware address and I could not resolve it as to an IP address.\n";
-+ return undef;
-+ }
-+ $ip_addr = inet_ntoa($h->addr);
-+ }
-+ # look up ip in /etc/ethers
-+ unless (open (ETHERS, '<', '/etc/ethers')) {
-+ warn "$host is not a hardware address and I could not open /etc/ethers.\n";
-+ return undef;
-+ }
-+ while (<ETHERS>) {
-+ if (($_ !~ m/^$/) && ($_ !~ m/^#/)) { # ignore comments
-+ my ($mac, $ip);
-+ ($mac, $ip) = split(' ', $_, 3);
-+ if ($ip =~ m/^$ip$/) {
-+ if ($ip eq $ip_addr) {
-+ $hwaddr = $mac;
-+ last;
-+ }
-+ next;
-+ } else {
-+ my $h2;
-+ unless ($h2 = gethost($ip)) {
-+ next;
-+ }
-+ if (inet_ntoa($h2->addr) eq $ip_addr) {
-+ $hwaddr = $mac;
-+ last;
-+ }
-+ }
-+ }
-+ }
-+ close (ETHERS);
-+ unless (defined($hwaddr)) {
-+ warn "Could not find $host in /etc/ethers\n";
-+ return undef;
-+ }
- }
-
- # Generate magic sequence
-@@ -68,7 +114,7 @@
-
- # Allocate socket and send packet
-
-- $raddr = gethostbyname($ipaddr);
-+ $raddr = gethostbyname($ipaddr)->addr;
- $them = pack_sockaddr_in($port, $raddr);
- $proto = getprotobyname('udp');
-
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-02-18 23:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-18 23:06 [gentoo-commits] repo/gentoo:master commit in: net-misc/wakeonlan/files/ Conrad Kostecki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox