View | Details | Raw Unified | Return to bug 224543
Collapse All | Expand All

(-)b/net/igmpproxy/Makefile (-6 / +15 lines)
Lines 2-20 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	igmpproxy
4
PORTNAME=	igmpproxy
5
PORTVERSION=	0.1
5
PORTVERSION=	0.2
6
PORTREVISION=	2
7
PORTEPOCH=	1
6
PORTEPOCH=	1
8
CATEGORIES=	net
7
CATEGORIES=	net
9
MASTER_SITES=	SF
10
8
11
MAINTAINER=	melifaro@ipfw.ru
9
MAINTAINER=	franco@opnsense.org
12
COMMENT=	Multicast forwarding IGMP proxy
10
COMMENT=	Multicast forwarding IGMP proxy
13
11
14
HOMEPAGE=	http://igmpproxy.sourceforge.net/
12
LICENSE=	GPLv2+
13
LICENSE_FILE=	${WRKSRC}/COPYING
14
15
USE_GITHUB=	yes
16
GH_ACCOUNT=	pali
15
17
16
USE_RC_SUBR=	igmpproxy
18
USE_RC_SUBR=	igmpproxy
17
USES=		gmake
19
USES=		autoreconf
18
GNU_CONFIGURE=	yes
20
GNU_CONFIGURE=	yes
19
21
22
EXTRA_PATCHES+=	${FILESDIR}/0001-Revert-Try-to-fix-problems-with-strict-aliasing.patch:-p1
23
EXTRA_PATCHES+= ${FILESDIR}/0002-Revert-Include-config.h-before-any-other-files-to-ma.patch:-p1
24
25
post-install:
26
	${INSTALL_DATA} ${WRKSRC}/igmpproxy.conf \
27
	    ${STAGEDIR}${PREFIX}/etc/igmpproxy.conf.sample
28
20
.include <bsd.port.mk>
29
.include <bsd.port.mk>
(-)b/net/igmpproxy/distinfo (-2 / +3 lines)
Lines 1-2 Link Here
1
SHA256 (igmpproxy-0.1.tar.gz) = ee18ff3d8c3ae3a29dccb7e5eedf332337330020168bd95a11cece8d7d7ee6ae
1
TIMESTAMP = 1513975936
2
SIZE (igmpproxy-0.1.tar.gz) = 140159
2
SHA256 (pali-igmpproxy-0.2_GH0.tar.gz) = 48fdaaa698c2ebe1c674b9ba4f9cb1369453bc97295434b608c9d5dab18c9293
3
SIZE (pali-igmpproxy-0.2_GH0.tar.gz) = 41732
(-)b/net/igmpproxy/files/0001-Revert-Try-to-fix-problems-with-strict-aliasing.patch (+84 lines)
Added Link Here
1
This reverts commit c371602f5f499a29d1fb1c43a8d12f21ff56296b.
2
---
3
 src/ifvc.c | 23 ++++++++++-------------
4
 1 file changed, 10 insertions(+), 13 deletions(-)
5
6
diff --git a/src/ifvc.c b/src/ifvc.c
7
index 3a7476d..2d487ed 100644
8
--- a/src/ifvc.c
9
+++ b/src/ifvc.c
10
@@ -34,13 +34,6 @@
11
 
12
 #include "igmpproxy.h"
13
 
14
-/* We need a temporary copy to not break strict aliasing rules */
15
-static inline uint32_t s_addr_from_sockaddr(const struct sockaddr *addr) {
16
-    struct sockaddr_in addr_in;
17
-    memcpy(&addr_in, addr, sizeof(addr_in));
18
-    return addr_in.sin_addr.s_addr;
19
-}
20
-
21
 struct IfDesc IfDescVc[ MAX_IF ], *IfDescEp = IfDescVc;
22
 
23
 /* aimwang: add for detect interface and rebuild IfVc record */
24
@@ -112,15 +105,17 @@ void rebuildIfVc () {
25
         }
26
 
27
         // Get the interface adress...
28
-        Dp->InAdr.s_addr = s_addr_from_sockaddr(&IfPt->ifr_addr);
29
+        Dp->InAdr = ((struct sockaddr_in *)&IfPt->ifr_addr)->sin_addr;
30
         addr = Dp->InAdr.s_addr;
31
 
32
         memcpy( IfReq.ifr_name, Dp->Name, sizeof( IfReq.ifr_name ) );
33
+        IfReq.ifr_addr.sa_family = AF_INET;
34
+        ((struct sockaddr_in *)&IfReq.ifr_addr)->sin_addr.s_addr = addr;
35
 
36
         // Get the subnet mask...
37
         if (ioctl(Sock, SIOCGIFNETMASK, &IfReq ) < 0)
38
             my_log(LOG_ERR, errno, "ioctl SIOCGIFNETMASK for %s", IfReq.ifr_name);
39
-        mask = s_addr_from_sockaddr(&IfReq.ifr_netmask);
40
+        mask = ((struct sockaddr_in *)&IfReq.ifr_addr)->sin_addr.s_addr;
41
         subnet = addr & mask;
42
 
43
         if ( ioctl( Sock, SIOCGIFFLAGS, &IfReq ) < 0 )
44
@@ -131,7 +126,7 @@ void rebuildIfVc () {
45
         {
46
             if ( ioctl( Sock, SIOCGIFDSTADDR, &IfReq ) < 0 )
47
                 my_log(LOG_ERR, errno, "ioctl SIOCGIFDSTADDR for %s", IfReq.ifr_name);
48
-            addr = s_addr_from_sockaddr(&IfReq.ifr_dstaddr);
49
+            addr = ((struct sockaddr_in *)&IfReq.ifr_dstaddr)->sin_addr.s_addr;
50
             subnet = addr & mask;
51
         }
52
 
53
@@ -263,15 +258,17 @@ void buildIfVc(void) {
54
             }
55
 
56
             // Get the interface adress...
57
-            IfDescEp->InAdr.s_addr = s_addr_from_sockaddr(&IfPt->ifr_addr);
58
+            IfDescEp->InAdr = ((struct sockaddr_in *)&IfPt->ifr_addr)->sin_addr;
59
             addr = IfDescEp->InAdr.s_addr;
60
 
61
             memcpy( IfReq.ifr_name, IfDescEp->Name, sizeof( IfReq.ifr_name ) );
62
+            IfReq.ifr_addr.sa_family = AF_INET;
63
+            ((struct sockaddr_in *)&IfReq.ifr_addr)->sin_addr.s_addr = addr;
64
 
65
             // Get the subnet mask...
66
             if (ioctl(Sock, SIOCGIFNETMASK, &IfReq ) < 0)
67
                 my_log(LOG_ERR, errno, "ioctl SIOCGIFNETMASK for %s", IfReq.ifr_name);
68
-            mask = s_addr_from_sockaddr(&IfReq.ifr_netmask);
69
+            mask = ((struct sockaddr_in *)&IfReq.ifr_addr)->sin_addr.s_addr;
70
             subnet = addr & mask;
71
 
72
             /* get if flags
73
@@ -293,7 +290,7 @@ void buildIfVc(void) {
74
             {
75
                 if ( ioctl( Sock, SIOCGIFDSTADDR, &IfReq ) < 0 )
76
                     my_log(LOG_ERR, errno, "ioctl SIOCGIFDSTADDR for %s", IfReq.ifr_name);
77
-                addr = s_addr_from_sockaddr(&IfReq.ifr_dstaddr);
78
+                addr = ((struct sockaddr_in *)&IfReq.ifr_dstaddr)->sin_addr.s_addr;
79
                 subnet = addr & mask;
80
             }
81
 
82
-- 
83
2.15.1
84
(-)b/net/igmpproxy/files/0002-Revert-Include-config.h-before-any-other-files-to-ma.patch (+32 lines)
Added Link Here
1
This reverts commit 7fcb7900b757b64cf58e6b2d1d473de289945e8d.
2
---
3
 src/igmpproxy.h | 6 +++---
4
 1 file changed, 3 insertions(+), 3 deletions(-)
5
6
diff --git a/src/igmpproxy.h b/src/igmpproxy.h
7
index ad1063b..6980e35 100644
8
--- a/src/igmpproxy.h
9
+++ b/src/igmpproxy.h
10
@@ -35,9 +35,6 @@
11
 *   igmpproxy.h - Header file for common includes.
12
 */
13
 
14
-#include "config.h"
15
-#include "os.h"
16
-
17
 #include <errno.h>
18
 #include <stdarg.h>
19
 #include <stdio.h>
20
@@ -60,6 +57,9 @@
21
 #include <netinet/in.h>
22
 #include <arpa/inet.h>
23
 
24
+#include "os.h"
25
+#include "config.h"
26
+
27
 /*
28
  * Limit on length of route data
29
  */
30
-- 
31
2.15.1
32
(-)a/net/igmpproxy/files/patch-Makefile.in (-14 lines)
Removed Link Here
1
--- Makefile.in.orig	2009-10-05 18:19:42 UTC
2
+++ Makefile.in
3
@@ -284,7 +284,10 @@
4
 	done | $(am__base_list) | \
5
 	while read files; do \
6
 	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(sysconfdir)'"; \
7
-	  $(INSTALL_DATA) $$files "$(DESTDIR)$(sysconfdir)" || exit $$?; \
8
+	  if [ ! -f "$(DESTDIR)$(sysconfdir)/$$files" ]; then \
9
+	  	$(INSTALL_DATA) $$files "$(DESTDIR)$(sysconfdir)" || exit $$?; \
10
+	  fi; \
11
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(sysconfdir)/$$files.sample" || exit $$?; \
12
 	done
13
 
14
 uninstall-dist_sysconfDATA:
(-)a/net/igmpproxy/files/patch-src__os-freebsd.h (-23 lines)
Removed Link Here
1
--- src/os-freebsd.h.orig	2009-10-06 02:07:06.000000000 +0800
2
+++ src/os-freebsd.h	2016-01-20 15:43:54.364740000 +0800
3
@@ -14,10 +14,20 @@
4
 
5
 static inline u_short ip_data_len(const struct ip *ip)
6
 {
7
+#if __FreeBSD_version >= 1100030
8
+	return ntohs(ip->ip_len) - (ip->ip_hl << 2);
9
+#elif __FreeBSD_version >= 900044
10
+	return ip->ip_len - (ip->ip_hl << 2);
11
+#else
12
 	return ip->ip_len;
13
+#endif
14
 }
15
 
16
 static inline void ip_set_len(struct ip *ip, u_short len)
17
 {
18
+#if __FreeBSD_version >= 1100030
19
+	ip->ip_len = htons(len);
20
+#else
21
 	ip->ip_len = len;
22
+#endif
23
 }
(-)b/net/igmpproxy/files/patch-src_igmpproxy.c (+14 lines)
Added Link Here
1
--- src/igmpproxy.c.orig	2017-12-22 20:49:54 UTC
2
+++ src/igmpproxy.c
3
@@ -37,11 +37,6 @@
4
 *   February 2005 - Johnny Egeland
5
 */
6
 
7
-/* getopt() and clock_getime() */
8
-#ifndef _POSIX_C_SOURCE
9
-#define _POSIX_C_SOURCE 200112L
10
-#endif
11
-
12
 #include "igmpproxy.h"
13
 
14
 static const char Usage[] =

Return to bug 224543