Browse code

tcp: added missing blacklist on write pollerr

Reported-and-tested-by: Vladimir Marek <vlada@iptel.org>

Andrei Pelinescu-Onciul authored on 23/04/2009 08:56:00
Showing 1 changed files
... ...
@@ -3499,11 +3499,21 @@ inline static int handle_tcpconn_ev(struct tcp_connection* tcpconn, short ev,
3499 3499
 			}
3500 3500
 			if (unlikely(ev & POLLERR)){
3501 3501
 				if (unlikely(tcpconn->state=S_CONN_CONNECT)){
3502
+#ifdef USE_DST_BLACKLIST
3503
+					if (cfg_get(core, core_cfg, use_dst_blacklist))
3504
+						dst_blacklist_su(BLST_ERR_CONNECT, tcpconn->rcv.proto,
3505
+											&tcpconn->rcv.src_su, 0);
3506
+#endif /* USE_DST_BLACKLIST */
3502 3507
 					TCP_EV_CONNECT_ERR(0, TCP_LADDR(tcpconn),
3503 3508
 										TCP_LPORT(tcpconn), TCP_PSU(tcpconn),
3504 3509
 										TCP_PROTO(tcpconn));
3505 3510
 					TCP_STATS_CONNECT_FAILED();
3506 3511
 				}else{
3512
+#ifdef USE_DST_BLACKLIST
3513
+					if (cfg_get(core, core_cfg, use_dst_blacklist))
3514
+						dst_blacklist_su(BLST_ERR_SEND, tcpconn->rcv.proto,
3515
+											&tcpconn->rcv.src_su, 0);
3516
+#endif /* USE_DST_BLACKLIST */
3507 3517
 					TCP_STATS_CON_RESET(); /* FIXME: it could != RST */
3508 3518
 				}
3509 3519
 			}