Date: Thu, 1 Jul 1999 23:26:03 +0200 (CEST) From: Dan Lukes <dan@obluda.cz> To: FreeBSD-gnats-submit@freebsd.org Subject: kern/12479: PATCH Send ICMP_SOURCEQUENCH when packet dropped by dummynet Message-ID: <199907012126.XAA44082@dan-h.fio.cz>
next in thread | raw e-mail | index | archive | help
>Number: 12479 >Category: kern >Synopsis: PATCH Send ICMP_SOURCEQUENCH when packet dropped by dummynet >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Jul 1 14:40:01 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Dan Lukes >Release: FreeBSD 3.2-RELEASE i386 >Organization: Obludarium >Environment: kernel with dummynet used for bandwidth limiting >Description: the dummynet drop packets silently without ICMP_SOURCEQUENCH message Althought the sending of ICMP after dropping is optional (MAY be send) some realtime applications (voice telephony, ...), especially UDP based has serious problem with flow control without it >How-To-Repeat: create limited pipe (ipfw pipe ...), route traffic into it (ipfw add pipe), create trafic ... >Fix: Send ICMP_SOURCEQUENCH if packed droped by pipe->queue_size or pipe->queue_size_bytes limit overflow. Don't send ICMP when packed dropped by random packet drop as it implement random packet droping on poor lines. *** ip_dummynet.c.ORIG Tue May 4 18:23:57 1999 --- ip_dummynet.c Thu Jul 1 22:33:27 1999 *************** *** 52,57 **** --- 52,58 ---- #include <netinet/ip_fw.h> #include <netinet/ip_dummynet.h> #include <netinet/ip_var.h> + #include <netinet/ip_icmp.h> #include "opt_bdg.h" #ifdef BRIDGE *************** *** 292,297 **** --- 293,299 ---- struct dn_pkt *pkt; struct dn_pipe *pipe; int len = m->m_pkthdr.len ; + int drop_by_rand=0; int s=splimp(); *************** *** 317,323 **** * should i drop ? * This section implements random packet drop. */ ! if ( (pipe->plr && random() < pipe->plr) || (pipe->queue_size && pipe->r_len >= pipe->queue_size) || (pipe->queue_size_bytes && len + pipe->r_len_bytes > pipe->queue_size_bytes) || --- 319,326 ---- * should i drop ? * This section implements random packet drop. */ ! drop_by_rand=(pipe->plr && random() < pipe->plr); ! if ( drop_by_rand || (pipe->queue_size && pipe->r_len >= pipe->queue_size) || (pipe->queue_size_bytes && len + pipe->r_len_bytes > pipe->queue_size_bytes) || *************** *** 328,333 **** --- 331,342 ---- printf("-- dummynet: drop from pipe %d, have %d pks, %d bytes\n", pipe_nr, pipe->r_len, pipe->r_len_bytes); pipe->r_drops++ ; + if (!drop_by_rand) { + register struct ip *ip = mtod(m, struct ip *); + struct mbuf *mcopy = m_copy(m, 0, imin((int)ip->ip_len, 64)); + + icmp_error(mcopy, ICMP_SOURCEQUENCH, 0, 0, NULL); + } m_freem(m); return 0 ; /* XXX error */ } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199907012126.XAA44082>