aboutsummaryrefslogtreecommitdiffstats
path: root/examples/old-patches
diff options
context:
space:
mode:
Diffstat (limited to 'examples/old-patches')
-rw-r--r--examples/old-patches/README17
-rw-r--r--examples/old-patches/dhcpd-never-broadcast.diff88
-rw-r--r--examples/old-patches/listen_all.git.patch28
-rw-r--r--examples/old-patches/vlc-git-sesse.patch131
-rw-r--r--examples/old-patches/vlc-mark.patch136
5 files changed, 400 insertions, 0 deletions
diff --git a/examples/old-patches/README b/examples/old-patches/README
new file mode 100644
index 0000000..bc6a962
--- /dev/null
+++ b/examples/old-patches/README
@@ -0,0 +1,17 @@
+
+Patches from pre TG14. None of these patches were in use under TG14.
+
+
+Includes various patch(es) we had to use.
+
+> dhcpd-never-broadcast.diff
+
+When using DHCP in routed networks, the router has to participate in rewriting
+and sending DHCP replies on to the user. Unfortunately, some devices,
+in particular Cisco's Nexus series of switches, drop such DHCP reply packets
+with the broadcast bit in the flags field of the DHCP message header set.
+Thi means that some operating systems, in particular Microsoft Windows Vista,
+can have problems getting DHCP to work in such environments. If you enable
+this flag, the DHCP server will never set the broadcast flags in the replies
+it sends, even if the client set the broadcast flag. This flag overrides
+the never-broadcast flag if both are set.
diff --git a/examples/old-patches/dhcpd-never-broadcast.diff b/examples/old-patches/dhcpd-never-broadcast.diff
new file mode 100644
index 0000000..ac6d24d
--- /dev/null
+++ b/examples/old-patches/dhcpd-never-broadcast.diff
@@ -0,0 +1,88 @@
+diff -ur isc-dhcp-4.1.1-P1/includes/dhcpd.h isc-dhcp-4.1.1-P1.patched//includes/dhcpd.h
+--- isc-dhcp-4.1.1-P1/includes/dhcpd.h 2012-04-04 16:49:44.000000000 +0200
++++ isc-dhcp-4.1.1-P1.patched//includes/dhcpd.h 2012-04-04 14:56:43.000000000 +0200
+@@ -626,6 +626,7 @@
+ #define SV_LIMIT_PREFS_PER_IA 57
+ #define SV_DELAYED_ACK 58
+ #define SV_MAX_ACK_DELAY 59
++#define SV_NEVER_BROADCAST 60
+
+ #if !defined (DEFAULT_PING_TIMEOUT)
+ # define DEFAULT_PING_TIMEOUT 1
+diff -ur isc-dhcp-4.1.1-P1/server/bootp.c isc-dhcp-4.1.1-P1.patched//server/bootp.c
+--- isc-dhcp-4.1.1-P1/server/bootp.c 2009-07-25 00:04:52.000000000 +0200
++++ isc-dhcp-4.1.1-P1.patched//server/bootp.c 2012-04-04 14:55:21.000000000 +0200
+@@ -283,6 +283,15 @@
+ &lease -> scope, oc, MDL))
+ raw.flags |= htons (BOOTP_BROADCAST);
+
++ /* The inverse. */
++ if ((oc = lookup_option (&server_universe,
++ options, SV_NEVER_BROADCAST)) &&
++ evaluate_boolean_option_cache (&ignorep, packet, lease,
++ (struct client_state *)0,
++ packet -> options, options,
++ &lease -> scope, oc, MDL))
++ raw.flags &= htons (~BOOTP_BROADCAST);
++
+ /* Figure out the address of the next server. */
+ memset (&d1, 0, sizeof d1);
+ oc = lookup_option (&server_universe, options, SV_NEXT_SERVER);
+diff -ur isc-dhcp-4.1.1-P1/server/dhcp.c isc-dhcp-4.1.1-P1.patched//server/dhcp.c
+--- isc-dhcp-4.1.1-P1/server/dhcp.c 2012-04-04 16:48:46.000000000 +0200
++++ isc-dhcp-4.1.1-P1.patched//server/dhcp.c 2012-04-04 14:55:45.000000000 +0200
+@@ -2482,6 +2482,15 @@
+ &lease -> scope, oc, MDL))
+ state -> bootp_flags |= htons (BOOTP_BROADCAST);
+
++ /* The inverse. */
++ if ((oc = lookup_option (&server_universe, state -> options,
++ SV_NEVER_BROADCAST)) &&
++ evaluate_boolean_option_cache (&ignorep, packet, lease,
++ (struct client_state *)0,
++ packet -> options, state -> options,
++ &lease -> scope, oc, MDL))
++ state -> bootp_flags &= htons (~BOOTP_BROADCAST);
++
+ /* Get the Maximum Message Size option from the packet, if one
+ was sent. */
+ oc = lookup_option (&dhcp_universe, packet -> options,
+diff -ur isc-dhcp-4.1.1-P1/server/dhcpd.conf.5 isc-dhcp-4.1.1-P1.patched//server/dhcpd.conf.5
+--- isc-dhcp-4.1.1-P1/server/dhcpd.conf.5 2012-04-04 16:48:46.000000000 +0200
++++ isc-dhcp-4.1.1-P1.patched//server/dhcpd.conf.5 2012-04-04 16:45:44.000000000 +0200
+@@ -1914,6 +1914,24 @@
+ .RE
+ .PP
+ The
++.I never-broadcast
++statement
++.RS 0.25i
++.PP
++.B never-broadcast \fIflag\fR\fB;\fR
++.PP
++When using DHCP in routed networks, the router has to participate in rewriting
++and sending DHCP replies on to the user. Unfortunately, some devices,
++in particular Cisco's Nexus series of switches, drop such DHCP reply packets
++with the broadcast bit in the flags field of the DHCP message header set.
++Thi means that some operating systems, in particular Microsoft Windows Vista,
++can have problems getting DHCP to work in such environments. If you enable
++this flag, the DHCP server will never set the broadcast flags in the replies
++it sends, even if the client set the broadcast flag. This flag overrides
++the never-broadcast flag if both are set.
++.RE
++.PP
++The
+ .I always-reply-rfc1048
+ statement
+ .RS 0.25i
+diff -ur isc-dhcp-4.1.1-P1/server/stables.c isc-dhcp-4.1.1-P1.patched//server/stables.c
+--- isc-dhcp-4.1.1-P1/server/stables.c 2012-04-04 16:49:44.000000000 +0200
++++ isc-dhcp-4.1.1-P1.patched//server/stables.c 2012-04-04 14:56:43.000000000 +0200
+@@ -203,6 +203,7 @@
+ { "always-reply-rfc1048", "f", &server_universe, 20, 1 },
+ { "site-option-space", "X", &server_universe, 21, 1 },
+ { "always-broadcast", "f", &server_universe, 22, 1 },
++ { "never-broadcast", "f", &server_universe, 60, 1 },
+ { "ddns-domainname", "t", &server_universe, 23, 1 },
+ { "ddns-hostname", "t", &server_universe, 24, 1 },
+ { "ddns-rev-domainname", "t", &server_universe, 25, 1 },
diff --git a/examples/old-patches/listen_all.git.patch b/examples/old-patches/listen_all.git.patch
new file mode 100644
index 0000000..41e1c87
--- /dev/null
+++ b/examples/old-patches/listen_all.git.patch
@@ -0,0 +1,28 @@
+diff --git a/src/network/io.c b/src/network/io.c
+index 7cc9764..08a0b56 100644
+--- a/src/network/io.c
++++ b/src/network/io.c
+@@ -87,14 +87,15 @@ int net_Socket (vlc_object_t *p_this, int family, int socktype,
+
+ setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, &(int){ 1 }, sizeof (int));
+
+-#ifdef IPV6_V6ONLY
+- /*
+- * Accepts only IPv6 connections on IPv6 sockets.
+- * If possible, we should open two sockets, but it is not always possible.
+- */
+- if (family == AF_INET6)
+- setsockopt (fd, IPPROTO_IPV6, IPV6_V6ONLY, &(int){ 1 }, sizeof (int));
+-#endif
++ // sesse fix monday night
++// #ifdef IPV6_V6ONLY
++// /*
++// * Accepts only IPv6 connections on IPv6 sockets.
++// * If possible, we should open two sockets, but it is not always possible.
++// */
++// if (family == AF_INET6)
++// setsockopt (fd, IPPROTO_IPV6, IPV6_V6ONLY, &(int){ 1 }, sizeof (int));
++// #endif
+
+ #if defined (WIN32)
+ # ifndef IPV6_PROTECTION_LEVEL
diff --git a/examples/old-patches/vlc-git-sesse.patch b/examples/old-patches/vlc-git-sesse.patch
new file mode 100644
index 0000000..a38b378
--- /dev/null
+++ b/examples/old-patches/vlc-git-sesse.patch
@@ -0,0 +1,131 @@
+diff --git a/modules/access_output/http.c b/modules/access_output/http.c
+index 61095f5..18ffc9a 100644
+--- a/modules/access_output/http.c
++++ b/modules/access_output/http.c
+@@ -72,9 +72,17 @@ vlc_module_begin ()
+ PASS_TEXT, PASS_LONGTEXT, true )
+ add_string( SOUT_CFG_PREFIX "mime", "",
+ MIME_TEXT, MIME_LONGTEXT, true )
++ add_integer( SOUT_CFG_PREFIX "mark-start", "",
++ "lol", "Fancy option", -1 )
++ add_integer( SOUT_CFG_PREFIX "mark-end", "",
++ "rotfl", "Should maybe also be set", -1 )
+ set_callbacks( Open, Close )
+ vlc_module_end ()
+
++// globals
++extern vlc_mutex_t mark_lock;
++extern int *mark_used;
++extern int mark_start, mark_end;
+
+ /*****************************************************************************
+ * Exported prototypes
+@@ -178,6 +186,21 @@ static int Open( vlc_object_t *p_this )
+ return VLC_EGENERIC;
+ }
+
++ fprintf(stderr, "tjobing\n");
++ if (mark_used == NULL) {
++ mark_start = var_InheritInteger( p_access, SOUT_CFG_PREFIX "mark-start");
++ mark_end = var_InheritInteger( p_access, SOUT_CFG_PREFIX "mark-end");
++ fprintf(stderr, "jabla: %d -> %d\n", mark_start, mark_end);
++
++ if (mark_start >= 0 && mark_end > mark_start) {
++ vlc_mutex_init(&mark_lock);
++ mark_used = (int *)malloc((mark_end - mark_start) * sizeof(int));
++ for (int i = 0; i < mark_end - mark_start; ++i) {
++ mark_used[i] = 0;
++ }
++ }
++ }
++
+ psz_user = var_GetNonEmptyString( p_access, SOUT_CFG_PREFIX "user" );
+ psz_pwd = var_GetNonEmptyString( p_access, SOUT_CFG_PREFIX "pwd" );
+ if( p_access->psz_access && !strcmp( p_access->psz_access, "mmsh" ) )
+diff --git a/src/libvlccore.sym b/src/libvlccore.sym
+index 25d83c5..335edda 100644
+--- a/src/libvlccore.sym
++++ b/src/libvlccore.sym
+@@ -631,3 +631,7 @@ xml_ReaderDelete
+ xml_ReaderReset
+ vlc_keycode2str
+ vlc_str2keycode
++mark_end
++mark_lock
++mark_start
++mark_used
+diff --git a/src/network/httpd.c b/src/network/httpd.c
+index f76c47c..d7897bb 100644
+--- a/src/network/httpd.c
++++ b/src/network/httpd.c
+@@ -67,6 +67,50 @@
+
+ static void httpd_ClientClean( httpd_client_t *cl );
+
++VLC_API vlc_mutex_t mark_lock;
++VLC_API int *mark_used = NULL;
++VLC_API int mark_start = -1;
++VLC_API int mark_end = -1;
++
++void mark_socket(int fd)
++{
++ vlc_mutex_lock(&mark_lock);
++ int best_mark = mark_start;
++ int best_mark_val = mark_used[0];
++
++ for (int i = 1; i < mark_end - mark_start; ++i) {
++ if (mark_used[i] < best_mark_val) {
++ best_mark = mark_start + i;
++ best_mark_val = mark_used[i];
++ }
++ }
++ fprintf( stderr, "PICKED MARK %d WITH OLD USAGE %d\n", best_mark, best_mark_val);
++ if (setsockopt (fd, SOL_SOCKET, SO_MARK, &best_mark, sizeof(best_mark)) == -1) {
++ perror("setsockopt(SO_MARK)");
++ } else {
++ ++mark_used[best_mark - mark_start];
++ }
++ vlc_mutex_unlock(&mark_lock);
++}
++
++void unmark_socket(int fd)
++{
++ int mark;
++ socklen_t mark_len = sizeof(mark);
++ if (getsockopt (fd, SOL_SOCKET, SO_MARK, &mark, &mark_len) == -1) {
++ perror("getsockopt(SO_MARK)");
++ return;
++ }
++ if (mark < mark_start || mark >= mark_end) {
++ fprintf("UNKNOWN MARK %d\n", mark);
++ }
++
++ vlc_mutex_lock(&mark_lock);
++ --mark_used[mark - mark_start];
++ fprintf(stderr, "UNMARKED MARK %d WITH NEW USAGE %d\n", mark, mark_used[mark - mark_start]);
++ vlc_mutex_unlock(&mark_lock);
++}
++
+ /* each host run in his own thread */
+ struct httpd_host_t
+ {
+@@ -1295,6 +1339,7 @@ static void httpd_ClientClean( httpd_client_t *cl )
+ {
+ if( cl->p_tls != NULL )
+ vlc_tls_SessionDelete( cl->p_tls );
++ unmark_socket( cl->fd );
+ net_Close( cl->fd );
+ cl->fd = -1;
+ }
+@@ -2309,6 +2354,11 @@ static void* httpd_HostThread( void *data )
+ setsockopt (fd, SOL_SOCKET, SO_REUSEADDR,
+ &(int){ 1 }, sizeof(int));
+
++ // find a free mark
++ if (mark_used != NULL) {
++ mark_socket(fd);
++ }
++
+ vlc_tls_t *p_tls;
+
+ if( host->p_tls != NULL )
diff --git a/examples/old-patches/vlc-mark.patch b/examples/old-patches/vlc-mark.patch
new file mode 100644
index 0000000..877b78c
--- /dev/null
+++ b/examples/old-patches/vlc-mark.patch
@@ -0,0 +1,136 @@
+diff -ur vlc-2.0.5/modules/access_output/http.c vlc-2.0.5.patchde/modules/access_output/http.c
+--- vlc-2.0.5/modules/access_output/http.c 2011-12-22 11:38:28.000000000 +0100
++++ vlc-2.0.5.patchde/modules/access_output/http.c 2013-02-07 01:23:10.966721881 +0100
+@@ -89,9 +89,17 @@
+ add_bool( SOUT_CFG_PREFIX "bonjour", false,
+ BONJOUR_TEXT, BONJOUR_LONGTEXT, true);
+ #endif
++ add_integer( SOUT_CFG_PREFIX "mark-start", "",
++ "lol", "Fancy option", -1 )
++ add_integer( SOUT_CFG_PREFIX "mark-end", "",
++ "rotfl", "Should maybe also be set", -1 )
+ set_callbacks( Open, Close )
+ vlc_module_end ()
+
++// globals
++extern vlc_mutex_t mark_lock;
++extern int *mark_used;
++extern int mark_start, mark_end;
+
+ /*****************************************************************************
+ * Exported prototypes
+@@ -199,6 +207,21 @@
+ return VLC_EGENERIC;
+ }
+
++ fprintf(stderr, "tjobing\n");
++ if (mark_used == NULL) {
++ mark_start = var_InheritInteger( p_access, SOUT_CFG_PREFIX "mark-start");
++ mark_end = var_InheritInteger( p_access, SOUT_CFG_PREFIX "mark-end");
++ fprintf(stderr, "jabla: %d -> %d\n", mark_start, mark_end);
++
++ if (mark_start >= 0 && mark_end > mark_start) {
++ vlc_mutex_init(&mark_lock);
++ mark_used = (int *)malloc((mark_end - mark_start) * sizeof(int));
++ for (int i = 0; i < mark_end - mark_start; ++i) {
++ mark_used[i] = 0;
++ }
++ }
++ }
++
+ psz_user = var_GetNonEmptyString( p_access, SOUT_CFG_PREFIX "user" );
+ psz_pwd = var_GetNonEmptyString( p_access, SOUT_CFG_PREFIX "pwd" );
+ if( p_access->psz_access && !strcmp( p_access->psz_access, "mmsh" ) )
+diff -ur vlc-2.0.5/src/libvlccore.sym vlc-2.0.5.patchde/src/libvlccore.sym
+--- vlc-2.0.5/src/libvlccore.sym 2012-05-15 14:41:19.000000000 +0200
++++ vlc-2.0.5.patchde/src/libvlccore.sym 2013-02-07 01:16:16.917330547 +0100
+@@ -673,3 +673,7 @@
+ xml_ReaderReset
+ vlc_keycode2str
+ vlc_str2keycode
++mark_end
++mark_lock
++mark_start
++mark_used
+diff -ur vlc-2.0.5/src/network/httpd.c vlc-2.0.5.patchde/src/network/httpd.c
+--- vlc-2.0.5/src/network/httpd.c 2012-09-04 00:14:53.000000000 +0200
++++ vlc-2.0.5.patchde/src/network/httpd.c 2013-02-07 01:35:50.777081814 +0100
+@@ -69,6 +69,50 @@
+
+ static void httpd_ClientClean( httpd_client_t *cl );
+
++VLC_API vlc_mutex_t mark_lock;
++VLC_API int *mark_used = NULL;
++VLC_API int mark_start = -1;
++VLC_API int mark_end = -1;
++
++void mark_socket(int fd)
++{
++ vlc_mutex_lock(&mark_lock);
++ int best_mark = mark_start;
++ int best_mark_val = mark_used[0];
++
++ for (int i = 1; i < mark_end - mark_start; ++i) {
++ if (mark_used[i] < best_mark_val) {
++ best_mark = mark_start + i;
++ best_mark_val = mark_used[i];
++ }
++ }
++ fprintf( stderr, "PICKED MARK %d WITH OLD USAGE %d\n", best_mark, best_mark_val);
++ if (setsockopt (fd, SOL_SOCKET, SO_MARK, &best_mark, sizeof(best_mark)) == -1) {
++ perror("setsockopt(SO_MARK)");
++ } else {
++ ++mark_used[best_mark - mark_start];
++ }
++ vlc_mutex_unlock(&mark_lock);
++}
++
++void unmark_socket(int fd)
++{
++ int mark;
++ socklen_t mark_len = sizeof(mark);
++ if (getsockopt (fd, SOL_SOCKET, SO_MARK, &mark, &mark_len) == -1) {
++ perror("getsockopt(SO_MARK)");
++ return;
++ }
++ if (mark < mark_start || mark >= mark_end) {
++ fprintf("UNKNOWN MARK %d\n", mark);
++ }
++
++ vlc_mutex_lock(&mark_lock);
++ --mark_used[mark - mark_start];
++ fprintf(stderr, "UNMARKED MARK %d WITH NEW USAGE %d\n", mark, mark_used[mark - mark_start]);
++ vlc_mutex_unlock(&mark_lock);
++}
++
+ /* each host run in his own thread */
+ struct httpd_host_t
+ {
+@@ -1412,6 +1456,7 @@
+ {
+ if( cl->p_tls != NULL )
+ vlc_tls_ServerSessionDelete( cl->p_tls );
++ unmark_socket( cl->fd );
+ net_Close( cl->fd );
+ cl->fd = -1;
+ }
+@@ -2461,6 +2506,11 @@
+ setsockopt (fd, SOL_SOCKET, SO_REUSEADDR,
+ &(int){ 1 }, sizeof(int));
+
++ // find a free mark
++ if (mark_used != NULL) {
++ mark_socket(fd);
++ }
++
+ vlc_tls_t *p_tls;
+
+ if( host->p_tls != NULL )
+@@ -2471,6 +2521,7 @@
+ case -1:
+ msg_Err( host, "Rejecting TLS connection" );
+ /* p_tls is destroyed implicitly */
++ unmark_socket( fd );
+ net_Close( fd );
+ fd = -1;
+ p_tls = NULL;