rpms/linux-igd/F-9 linuxigd-1.0-restrict-internal-interface.patch, NONE, 1.1 linux-igd.spec, 1.3, 1.4

HASEGAWA Masahiro (masahase) fedora-extras-commits at redhat.com
Mon Aug 4 15:42:52 UTC 2008


Author: masahase

Update of /cvs/pkgs/rpms/linux-igd/F-9
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20433/F-9

Modified Files:
	linux-igd.spec 
Added Files:
	linuxigd-1.0-restrict-internal-interface.patch 
Log Message:
Fix Bug #457730


linuxigd-1.0-restrict-internal-interface.patch:

--- NEW FILE linuxigd-1.0-restrict-internal-interface.patch ---
diff -uNr linuxigd-1.0/util.c linuxigd-1.0-patched/util.c
--- linuxigd-1.0/util.c	2006-08-02 07:48:00.000000000 +0900
+++ linuxigd-1.0-patched/util.c	2008-08-04 23:13:03.000000000 +0900
@@ -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);
diff -uNr linuxigd-1.0/util.h linuxigd-1.0-patched/util.h
--- linuxigd-1.0/util.h	2006-08-02 07:48:00.000000000 +0900
+++ linuxigd-1.0-patched/util.h	2008-08-04 23:13:03.000000000 +0900
@@ -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_


Index: linux-igd.spec
===================================================================
RCS file: /cvs/pkgs/rpms/linux-igd/F-9/linux-igd.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- linux-igd.spec	19 Feb 2008 13:03:43 -0000	1.3
+++ linux-igd.spec	4 Aug 2008 15:42:21 -0000	1.4
@@ -3,11 +3,12 @@
 Summary: The Linux UPNP Internet GATEWAY DEVICE
 Name: linux-igd
 Version: 1.0
-Release: 5%{?dist}
+Release: 6%{?dist}
 URL: http://linux-igd.sourceforge.net/index.php
 Source0: http://downloads.sourceforge.net/%{name}/%{source_name}-%{version}.tar.gz
 Patch1: %{source_name}-%{version}.patch
 Patch0: %{name}-%{version}-to-cvs20070630.patch
+Patch2: %{source_name}-%{version}-restrict-internal-interface.patch
 License: GPL+
 Group: System Environment/Daemons
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
@@ -69,6 +70,8 @@
 fi
 
 %changelog
+* Mon Aug 4 2008 Masahiro Hasegawa <masahase at gmail.com> - 1.0-6
+- Fix Bug #457730
 * Tue Feb 19 2008 Fedora Release Engineering <rel-eng at fedoraproject.org> - 1.0-5
 - Autorebuild for GCC 4.3
 




More information about the fedora-extras-commits mailing list