Hello community,

here is the log from the commit of package xinetd for openSUSE:Factory checked 
in at 2016-07-01 09:54:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xinetd (Old)
 and      /work/SRC/openSUSE:Factory/.xinetd.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "xinetd"

Changes:
--------
--- /work/SRC/openSUSE:Factory/xinetd/xinetd.changes    2015-09-03 
18:03:42.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.xinetd.new/xinetd.changes       2016-07-01 
09:54:33.000000000 +0200
@@ -1,0 +2,6 @@
+Wed Jun 15 12:29:38 UTC 2016 - [email protected]
+
+- Add patch to fix bnc#972691 random bind fail:
+  * xinetd-2.3.14-retry-binds.patch
+
+-------------------------------------------------------------------

New:
----
  xinetd-2.3.14-retry-binds.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ xinetd.spec ++++++
--- /var/tmp/diff_new_pack.W8J0kf/_old  2016-07-01 09:54:34.000000000 +0200
+++ /var/tmp/diff_new_pack.W8J0kf/_new  2016-07-01 09:54:34.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package xinetd
 #
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -45,6 +45,7 @@
 Patch16:        xinetd-2.3.14-file-limit.patch
 Patch17:        xinetd-2.3.14-restore-nofile-limits.patch
 Patch18:        xinetd-deactivating-error.patch
+Patch19:        xinetd-2.3.14-retry-binds.patch
 BuildRequires:  autoconf
 BuildRequires:  systemd
 BuildRequires:  tcpd-devel
@@ -77,6 +78,7 @@
 %patch16 -p1
 %patch17 -p1
 %patch18 -p1
+%patch19 -p1
 
 # FAQ, README.SUSE and logrotate
 cp %{SOURCE2} %{SOURCE3} %{SOURCE5} .

++++++ xinetd-2.3.14-retry-binds.patch ++++++
Index: xinetd-xinetd-2-3-15/xinetd/service.c
===================================================================
--- xinetd-xinetd-2-3-15.orig/xinetd/service.c
+++ xinetd-xinetd-2-3-15/xinetd/service.c
@@ -235,6 +235,8 @@ static status_e activate_rpc( struct ser
 
 #endif   /* ! NO_RPC */
 
+#define MAX_BIND_ATTEMPTS 10
+
 static status_e activate_normal( struct service *sp )
 {
    union xsockaddr         tsin;
@@ -245,10 +247,21 @@ static status_e activate_normal( struct
    const char             *func           = "activate_normal" ;
    unsigned int            sin_len        = sizeof(tsin);
    int                     on             = 1;
+   int                     retries        = MAX_BIND_ATTEMPTS;
+   useconds_t              bind_retry_delay= 0;
+   char                   *brd_str        = NULL;
 #ifdef IPV6_V6ONLY
    int                     v6on           = 0;
 #endif
 
+   brd_str = getenv("XINETD_BIND_DELAY");
+   if (brd_str) {
+      bind_retry_delay = atoi(brd_str);
+      if (bind_retry_delay < 0 || bind_retry_delay > 500000) {
+         bind_retry_delay = 0;
+      }
+   }
+
    if( SC_BIND_ADDR(scp) != NULL )
       memcpy(&tsin, SC_BIND_ADDR(scp), sin_len);
    else
@@ -298,10 +311,18 @@ static status_e activate_normal( struct
               "setsockopt SO_KEEPALIVE failed (%m). service = %s", sid ) ;
    }
 
-   if ( bind( sd, &tsin.sa, sin_len ) == -1 )
+   while ( bind( sd, &tsin.sa, sin_len ) == -1 )
    {
       msg( LOG_ERR, func, "bind failed (%m). service = %s", sid ) ;
-      return( FAILED ) ;
+      if (retries-- > 0) {
+         msg( LOG_NOTICE, func,
+              "bind retry attempt %i", MAX_BIND_ATTEMPTS - retries);
+         if (bind_retry_delay) {
+            usleep(bind_retry_delay);
+         }
+      } else {
+         return( FAILED ) ;
+      }
    }
 
 #ifdef IN_MULTICAST

Reply via email to