Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 1476921 Details for
Bug 1619025
Add support for binding to a specific address
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch that adds a -b option for binding to a desired interface.
wol-0.7.1-bind.patch (text/plain), 3.19 KB, created by
Fritz Elfert
on 2018-08-19 16:58:33 UTC
(
hide
)
Description:
Patch that adds a -b option for binding to a desired interface.
Filename:
MIME Type:
Creator:
Fritz Elfert
Created:
2018-08-19 16:58:33 UTC
Size:
3.19 KB
patch
obsolete
>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 18:40:48.006405143 +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 18:40:21.717049724 +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 18:40:21.718049736 +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 18:40:21.718049736 +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\ >@@ -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)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1619025
:
1476921
|
1476990