rpms/linux-igd/devel linuxigd-1.0-restrict-internal-interface.patch, NONE, 1.1 linux-igd.spec, 1.4, 1.5

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


Author: masahase

Update of /cvs/pkgs/rpms/linux-igd/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8956

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/devel/linux-igd.spec,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- linux-igd.spec	17 May 2008 12:51:52 -0000	1.4
+++ linux-igd.spec	4 Aug 2008 14:42:26 -0000	1.5
@@ -3,11 +3,12 @@
 Summary: The Linux UPNP Internet GATEWAY DEVICE
 Name: linux-igd
 Version: 1.0
-Release: 6%{?dist}
+Release: 7%{?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
@@ -27,6 +28,7 @@
 %setup -q -c -n %{name}
 %patch0
 %patch1
+%patch2
 
 %build
 pushd %{source_name}-%{version}
@@ -69,6 +71,8 @@
 fi
 
 %changelog
+* Mon Aug 4 2008 Masahiro Hasegawa <masahase at gmail.com> - 1.0-7
+- Fix Bug #457730 
 * Sat May 17 2008 Masahiro Hasegawa <masahase at gmail.com> - 1.0-6
 - Fix dependencies
 * Tue Feb 19 2008 Fedora Release Engineering <rel-eng at fedoraproject.org> - 1.0-5




More information about the scm-commits mailing list