diff -ur x/iptables-1.4.18/libiptc/libiptc.c iptables-1.4.18/libiptc/libiptc.c --- x/iptables-1.4.18/libiptc/libiptc.c 2013-03-03 14:40:11.000000000 -0700 +++ iptables-1.4.18/libiptc/libiptc.c 2013-06-03 16:03:31.819448019 -0600 @@ -2596,8 +2596,10 @@ } #endif - ret = setsockopt(handle->sockfd, TC_IPPROTO, SO_SET_REPLACE, repl, + do { + ret = setsockopt(handle->sockfd, TC_IPPROTO, SO_SET_REPLACE, repl, sizeof(*repl) + repl->size); + } while ( ret < 0 && ( errno == EAGAIN || errno == EINPROGRESS)); if (ret < 0) goto out_free_newcounters; @@ -2672,8 +2674,10 @@ } #endif - ret = setsockopt(handle->sockfd, TC_IPPROTO, SO_SET_ADD_COUNTERS, + do { + ret = setsockopt(handle->sockfd, TC_IPPROTO, SO_SET_ADD_COUNTERS, newcounters, counterlen); + } while ( ret < 0 && ( errno == EAGAIN || errno == EINPROGRESS)); if (ret < 0) goto out_free_newcounters;