--- trunk/globals.h	2018-02-10 03:48:04 UTC
+++ trunk/globals.h	2018-02-18 08:34:25 UTC
@@ -876,6 +876,9 @@
 	int16_t         listenertype;
 	//int32_t       s_port;
 	IN_ADDR_T       s_ip;
+#ifdef IPV6SUPPORT
+	IN_ADDR_T       s_ipv6;
+#endif
 	uint16_t        bufsize;
 	void            *(*s_handler)(struct s_client *, uchar *, int32_t);
 	void (*s_init)(struct s_client *);
@@ -2042,6 +2045,9 @@
 	int8_t          c35_udp_suppresscmd08;
 	PTAB            c35_tcp_ptab;
 	IN_ADDR_T       c35_tcp_srvip;
+#ifdef IPV6SUPPORT
+	IN_ADDR_T       c35_tcp_srvipv6;
+#endif
 #endif
 	int8_t          c35_suppresscmd08; // used in cccam module
 	int8_t		getblockemmauprovid;
@@ -2049,6 +2055,9 @@
 #ifdef MODULE_NEWCAMD
 	PTAB            ncd_ptab;
 	IN_ADDR_T       ncd_srvip;
+#ifdef IPV6SUPPORT
+	IN_ADDR_T       ncd_srvipv6;
+#endif
 	uint8_t         ncd_key[14];
 	int8_t          ncd_keepalive;
 	int8_t          ncd_mgclient;
@@ -2066,6 +2075,9 @@
 	int8_t          cc_ignore_reshare;
 	int32_t         cc_update_interval;
 	IN_ADDR_T       cc_srvip;
+#ifdef IPV6SUPPORT
+	IN_ADDR_T       cc_srvipv6;
+#endif
 	char            cc_version[7];
 	int8_t          cc_minimize_cards;
 	int8_t          cc_keep_connected;
--- trunk/module-camd35.c	2018-02-10 03:48:06 UTC
+++ trunk/module-camd35.c	2018-02-18 08:33:26 UTC
@@ -935,6 +935,9 @@
 	ph->listenertype = LIS_CAMD35TCP;
 	ph->ptab = cfg.c35_tcp_ptab;
 	IP_ASSIGN(ph->s_ip, cfg.c35_tcp_srvip);
+#ifdef IPV6SUPPORT
+        IP_ASSIGN(ph->s_ipv6, cfg.c35_tcp_srvipv6);
+#endif
 	ph->s_handler = camd35_server;
 	ph->recv = camd35_recv;
 	ph->send_dcw = camd35_send_dcw;
--- trunk/module-cccam.c	2018-02-10 03:48:06 UTC
+++ trunk/module-cccam.c	2018-02-18 08:28:34 UTC
@@ -4265,6 +4265,9 @@
 	ph->c_send_emm = cc_send_emm;
 #ifdef MODULE_CCCSHARE
 	IP_ASSIGN(ph->s_ip, cfg.cc_srvip);
+#ifdef IPV6SUPPORT
+	IP_ASSIGN(ph->s_ipv6, cfg.cc_srvipv6);
+#endif
 	ph->s_handler = cc_srv_init;
 	ph->s_init = cc_srv_init2;
 	ph->s_idle = cc_s_idle;
--- trunk/module-newcamd.c	2018-02-10 03:48:06 UTC
+++ trunk/module-newcamd.c	2018-02-18 08:37:18 UTC
@@ -1577,6 +1577,9 @@
 	ph->large_ecm_support = 1;
 	ph->listenertype = LIS_NEWCAMD;
 	IP_ASSIGN(ph->s_ip, cfg.ncd_srvip);
+#ifdef IPV6SUPPORT
+	IP_ASSIGN(ph->s_ipv6, cfg.ncd_srvipv6);
+#endif
 	ph->s_handler = newcamd_server;
 	ph->s_init = newcamd_server_init;
 	ph->recv = newcamd_recv;
--- trunk/module-webif.c	2018-02-10 03:48:05 UTC
+++ trunk/module-webif.c	2018-02-18 08:00:43 UTC
@@ -8533,7 +8533,12 @@
 		{
 			struct sockaddr_in6 *ia = (struct sockaddr_in6 *)&sin;
 			ia->sin6_family = AF_INET6;
-			ia->sin6_addr = in6addr_any;
+			if(IP_ISSET(cfg.http_srvip))
+				ia->sin6_addr = cfg.http_srvip;
+			else if(IP_ISSET(cfg.srvip))
+				ia->sin6_addr = cfg.srvip;
+			else
+				ia->sin6_addr = in6addr_any;
 			ia->sin6_port = htons(cfg.http_port);
 		}
 	}
--- trunk/oscam.c	2018-02-10 03:48:06 UTC
+++ trunk/oscam.c	2018-02-18 08:23:02 UTC
@@ -1845,9 +1845,22 @@
 		struct s_module *module = &modules[i];
 		if((module->type & MOD_CONN_NET))
 		{
+#ifdef IPV6SUPPORT
+			//the dirtiest hack ever
+			//poormans multibind approach!!1111elf
+			int8_t ipv6dualbind = 0;
+#endif
 			for(j = 0; j < module->ptab.nports; j++)
 			{
+#ifdef IPV6SUPPORT
+				start_listener(module, &module->ptab.ports[j], ipv6dualbind);
+				if(IP_ISSET(module->s_ipv6) && !ipv6dualbind)
+					ipv6dualbind = 1;
+				else
+					ipv6dualbind = 0;
+#else
 				start_listener(module, &module->ptab.ports[j]);
+#endif
 			}
 		}
 	}
--- trunk/oscam-config-global.c	2018-02-10 03:48:05 UTC
+++ trunk/oscam-config-global.c	2018-02-18 08:36:48 UTC
@@ -740,6 +740,9 @@
 	DEF_OPT_SAVE_FUNC(cs378x_should_save_fn),
 	DEF_OPT_FUNC("port"				, OFS(c35_tcp_ptab)			, porttab_camd35_fn	, .free_value = porttab_free_fn),
 	DEF_OPT_FUNC("serverip"			, OFS(c35_tcp_srvip)		, serverip_fn),
+#ifdef IPV6SUPPORT
+	DEF_OPT_FUNC("serveripv6"		, OFS(c35_tcp_srvipv6)		, serverip_fn),
+#endif
 	DEF_OPT_INT8("suppresscmd08"	, OFS(c35_tcp_suppresscmd08), 0),
 	DEF_LAST_OPT
 };
@@ -758,6 +761,9 @@
 	DEF_OPT_SAVE_FUNC(newcamd_should_save_fn),
 	DEF_OPT_FUNC("port"			, OFS(ncd_ptab)		, porttab_fn, .free_value = porttab_free_fn),
 	DEF_OPT_FUNC("serverip"		, OFS(ncd_srvip)	, serverip_fn),
+#ifdef IPV6SUPPORT
+	DEF_OPT_FUNC("serveripv6"	, OFS(ncd_srvipv6)	, serverip_fn),
+#endif
 	DEF_OPT_FUNC("allowed"		, OFS(ncd_allowed)	, iprange_fn, .free_value = iprange_free_fn),
 	DEF_OPT_HEX("key"			, OFS(ncd_key)		, SIZEOF(ncd_key)),
 	DEF_OPT_INT8("keepalive"	, OFS(ncd_keepalive), DEFAULT_NCD_KEEPALIVE),
@@ -799,6 +805,9 @@
 	DEF_OPT_SAVE_FUNC(cccam_should_save_fn),
 	DEF_OPT_FUNC("port"			, OFS(cc_port),			cccam_port_fn),
 	DEF_OPT_FUNC("serverip"			, OFS(cc_srvip),		serverip_fn),
+#ifdef IPV6SUPPORT
+	DEF_OPT_FUNC("serveripv6"		, OFS(cc_srvipv6),		serverip_fn),
+#endif
 	DEF_OPT_HEX("nodeid"			, OFS(cc_fixed_nodeid),		SIZEOF(cc_fixed_nodeid)),
 	DEF_OPT_SSTR("version"			, OFS(cc_version),		"", SIZEOF(cc_version)),
 	DEF_OPT_INT8("reshare"			, OFS(cc_reshare),		10),
--- trunk/oscam-net.c	2018-02-10 03:48:06 UTC
+++ trunk/oscam-net.c	2018-02-18 08:56:28 UTC
@@ -633,7 +633,11 @@
 #endif
 }
 
+#ifdef IPV6SUPPORT
+int32_t start_listener(struct s_module *module, struct s_port *port, int8_t ipv6dualbind)
+#else
 int32_t start_listener(struct s_module *module, struct s_port *port)
+#endif
 {
 	int32_t ov = 1, timeout, is_udp, i;
 	char ptxt[2][45];
@@ -651,8 +655,21 @@
 	memset(&sad, 0 , sizeof(sad));
 #ifdef IPV6SUPPORT
 	SIN_GET_FAMILY(sad) = AF_INET6;
-	SIN_GET_ADDR(sad) = in6addr_any;
 	sad_len = sizeof(struct sockaddr_in6);
+	if(!IP_ISSET(module->s_ip))
+		{ module->s_ip = cfg.srvip; }
+	if(IP_ISSET(module->s_ip))
+	{
+		if(IP_ISSET(module->s_ipv6) && ipv6dualbind)
+			SIN_GET_ADDR(sad) = module->s_ipv6;
+		else
+			SIN_GET_ADDR(sad) = module->s_ip;
+		snprintf(ptxt[0], sizeof(ptxt[0]), ", ip=%s", cs_inet_ntoa(SIN_GET_ADDR(sad)));
+	}
+	else
+	{
+		SIN_GET_ADDR(sad) = in6addr_any;        
+	}
 #else
 	sad.sin_family = AF_INET;
 	sad_len = sizeof(struct sockaddr);
--- trunk/oscam-net.h	2018-02-10 03:48:06 UTC
+++ trunk/oscam-net.h	2018-02-18 08:21:30 UTC
@@ -41,7 +41,11 @@
 int32_t recv_from_udpipe(uchar *);
 int32_t process_input(uint8_t *buf, int32_t buflen, int32_t timeout);
 int32_t accept_connection(struct s_module *module, int8_t module_idx, int8_t port_idx);
+#ifdef IPV6SUPPORT
+int32_t start_listener(struct s_module *module, struct s_port *port, int8_t ipv6dualbind);
+#else
 int32_t start_listener(struct s_module *module, struct s_port *port);
+#endif
 
 #ifdef __CYGWIN__
 ssize_t cygwin_recv(int sock, void *buf, int count, int tflags);
