public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Fabian Affolter <mail@fabian-affolter.ch>
To: git-commits@fedoraproject.org
Subject: [rpms/wol] epel10: * Thu Sep 06 2018 Fabian Affolter <mail@fabian-affolter.ch> - 0.7.1-20
Date: Thu, 01 Oct 2026 18:03:52 GMT	[thread overview]
Message-ID: <179087783245.1.12796223467873691798.rpms-wol-44843d7880ae@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/wol
            Branch : epel10
            Commit : 44843d7880ae9358a04531d119ce87aab9f94857
            Author : Fabian Affolter <mail@fabian-affolter.ch>
            Date   : 2018-09-06T09:30:59+02:00
            Stats  : +133/-2 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/wol/c/44843d7880ae9358a04531d119ce87aab9f94857?branch=epel10

            Log:
            * Thu Sep 06 2018 Fabian Affolter <mail@fabian-affolter.ch> - 0.7.1-20
- Add patch for binding to interface (rhbz#1619025)

---
diff --git a/wol-0.7.1-binding.patch b/wol-0.7.1-binding.patch
new file mode 100644
index 0000000..2e038de
--- /dev/null
+++ b/wol-0.7.1-binding.patch
@@ -0,0 +1,127 @@
+diff -urw wol-0.7.1-orig/doc/wol.texi wol-0.7.1/doc/wol.texi
+--- wol-0.7.1-orig/doc/wol.texi	2004-04-18 10:52:18.000000000 +0200
++++ wol-0.7.1/doc/wol.texi	2018-08-19 23:45:59.526088977 +0200
+@@ -236,6 +236,13 @@
+ (default IP address is @code{255.255.255.255}).
+ 
+ 
++@item -b HOST
++@itemx --bind=HOST
++
++Bind to this IP address or hostname. This allows broadcasting on multihomed
++hosts by specifying the IP address of the desired outgoing interface.
++
++
+ @item -p NUM
+ @itemx --port=NUM
+ 
+diff -urw wol-0.7.1-orig/include/net.h wol-0.7.1/include/net.h
+--- wol-0.7.1-orig/include/net.h	2004-02-05 19:20:07.000000000 +0100
++++ wol-0.7.1/include/net.h	2018-08-19 23:45:59.526088977 +0200
+@@ -27,6 +27,7 @@
+ 
+ #include <sys/types.h>
+ 
++int bind_to_addr(int sockfd, const char *ip_str);
+ 
+ int udp_open (void);
+ 
+diff -urw wol-0.7.1-orig/src/net.c wol-0.7.1/src/net.c
+--- wol-0.7.1-orig/src/net.c	2004-04-20 21:51:18.000000000 +0200
++++ wol-0.7.1/src/net.c	2018-08-19 23:45:59.526088977 +0200
+@@ -100,7 +100,33 @@
+   return sockfd;
+ }
+ 
++int
++bind_to_addr(int sockfd, const char *ip_str)
++{
++  struct sockaddr_in toaddr;
++
++  if (ip_str == NULL)
++    {
++      return -1;
++    }
+ 
++  memset (&toaddr, 0, sizeof (struct sockaddr_in));
++
++  if (net_resolv (ip_str, &toaddr.sin_addr))
++    {
++      error (0, 0, _("Invalid IP address given: %s"), strerror (errno));
++      return -1;
++    }
++
++  toaddr.sin_family = AF_INET;
++
++  if (bind (sockfd, (const struct sockaddr *) &toaddr, sizeof (toaddr)))
++    {
++      error (0, 0, _("Couldn't bind to %s: %s"), ip_str, strerror (errno));
++      return -1;
++    }
++  return 0;
++}
+ 
+ int
+ tcp_open (const char *ip_str,
+diff -urw wol-0.7.1-orig/src/wol.c wol-0.7.1/src/wol.c
+--- wol-0.7.1-orig/src/wol.c	2004-04-18 13:42:11.000000000 +0200
++++ wol-0.7.1/src/wol.c	2018-08-19 23:47:31.440398340 +0200
+@@ -56,6 +56,9 @@
+ /* IP Address or hostname magic packet is addressed to */
+ static char *host_str = DEFAULT_IPADDR;
+ 
++/* IP Address or hostname to bind to */
++static char *bind_str = NULL;
++
+ /* filename with mac addresses */
+ static char *pathname = NULL;
+ 
+@@ -107,6 +110,7 @@
+ -f, --file=FILE     read addresses from file FILE (\"-\" reads from stdin)\n\
+     --passwd[=PASS] send SecureON password PASS (if no PASS is given, you\n\
+                     will be prompted for the password)\n\
++-b, --bind=HOST     bind to this IP address or hostname\n\
+ \n\
+ Each MAC-ADDRESS is written as x:x:x:x:x:x, where x is a hexadecimal number\n\
+ between 0 and ff which represents one byte of the address, which is in\n\
+@@ -144,7 +148,7 @@
+   int c;
+   int option_index;
+   int password_set = 0;
+-  char *options = "Vvw:h:i:p:f:s:-";
++  char *options = "Vvw:h:i:p:f:s:b:-";
+   static struct option long_options[] = 
+     {
+       { "help", no_argument, NULL, 'H' },
+@@ -156,6 +160,7 @@
+       { "port", required_argument, NULL, 'p' },
+       { "file", required_argument, NULL, 'f' },
+       { "passwd", optional_argument, NULL, 'P' },
++      { "bind", required_argument, NULL, 'b' },
+       /* { "proxy", required_argument, NULL, 's' }, */
+       { NULL, 0, NULL, 0 }
+     };
+@@ -209,6 +214,9 @@
+ 	  host_str = optarg;
+ 	  break;
+ 
++	case 'b':
++	  bind_str = optarg;
++	  break;
+ 
+ 	case 'p':
+ 	  if ((sscanf (optarg, "%5u", &port) != 1) ||
+@@ -370,6 +378,13 @@
+       exit (1);
+     }
+ 
++  if (NULL != bind_str)
++    {
++      if (bind_to_addr (sockfd, bind_str))
++        {
++          exit (1);
++        }
++    }
+ 
+   /* loop through possible MAC addresses */
+   if (!request_stdin)

diff --git a/wol.spec b/wol.spec
index e58462b..d06e76f 100644
--- a/wol.spec
+++ b/wol.spec
@@ -1,12 +1,13 @@
 Name:           wol
 Version:        0.7.1
-Release:        19%{?dist}
+Release:        20%{?dist}
 Summary:        Wake On Lan client
 
 Group:          Applications/Internet
 License:        GPLv2+
 URL:            http://sourceforge.net/projects/wake-on-lan/
 Source0:        http://downloads.sourceforge.net/wake-on-lan/%{name}-%{version}.tar.gz
+Patch0:         wol-0.7.1-binding.patch
 
 BuildRequires:  gcc
 BuildRequires:  gettext
@@ -21,6 +22,7 @@ hardware that is Magic Packet compliant. SecureON is supported by wol too.
 
 %prep
 %setup -q
+%patch0 -p1 -b .binding
 
 %build
 %configure --disable-static
@@ -30,7 +32,6 @@ touch -c -r ChangeLog ChangeLog.conv
 mv ChangeLog.conv ChangeLog
 
 %install
-rm -rf %{buildroot}
 make install DESTDIR=%{buildroot} INSTALL="install -p"
 rm -f %{buildroot}%{_infodir}/dir
 %find_lang %{name}
@@ -50,6 +51,9 @@ fi
 %{_bindir}/%{name}*
 
 %changelog
+* Thu Sep 06 2018 Fabian Affolter <mail@fabian-affolter.ch> - 0.7.1-20
+- Add patch for binding to interface (rhbz#1619025)
+
 * Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.1-19
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
 

                 reply	other threads:[~2026-10-01 18:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179087783245.1.12796223467873691798.rpms-wol-44843d7880ae@fedoraproject.org \
    --to=mail@fabian-affolter.ch \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox