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 313345 Details for
Bug 457730
linux-igd: linux-igd does not restrict itself to the internal interface
[?]
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]
Proposed patch
bindtodevice.diff (text/plain), 1.66 KB, created by
Jan Lieskovsky
on 2008-08-04 10:42:20 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Jan Lieskovsky
Created:
2008-08-04 10:42:20 UTC
Size:
1.66 KB
patch
obsolete
>Index: util.c >=================================================================== >RCS file: /cvsroot/linux-igd/linux-igd/util.c,v >retrieving revision 1.3 >diff -u -r1.3 util.c >--- util.c 1 Aug 2006 22:48:00 -0000 1.3 >+++ util.c 6 Sep 2007 15:25:34 -0000 >@@ -8,10 +8,11 @@ > #include <netinet/in.h> > #include <sys/ioctl.h> > #include <sys/socket.h> >+#include <unistd.h> > #include "globals.h" > > >-static int get_sockfd(void) >+static int get_sockfd(const char *ifname) > { > static int sockfd = -1; > >@@ -22,18 +23,26 @@ > perror("user: socket creating failed"); > return (-1); > } >+ >+ if (setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE, ifname, sizeof(ifname))) >+ { >+ perror("could not bind to device"); >+ close(sockfd); >+ return (-1); >+ } >+ > } > return sockfd; > } > >-int GetIpAddressStr(char *address, char *ifname) >+int GetIpAddressStr(char *address, const char *ifname) > { > struct ifreq ifr; > struct sockaddr_in *saddr; > int fd; > int succeeded = 0; > >- fd = get_sockfd(); >+ fd = get_sockfd(ifname); > if (fd >= 0 ) > { > strncpy(ifr.ifr_name, ifname, IFNAMSIZ); >Index: util.h >=================================================================== >RCS file: /cvsroot/linux-igd/linux-igd/util.h,v >retrieving revision 1.3 >diff -u -r1.3 util.h >--- util.h 1 Aug 2006 22:48:00 -0000 1.3 >+++ util.h 6 Sep 2007 15:25:34 -0000 >@@ -1,8 +1,8 @@ > #ifndef _UTIL_H_ > #define _UTIL_H_ > >-int get_sockfd(void); >-int GetIpAddressStr(char *address, char *ifname); >+int get_sockfd(const char *ifname); >+int GetIpAddressStr(char *address, const char *ifname); > void trace(int debuglevel, const char *format, ...); > > #endif //_UTIL_H_
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 457730
: 313345