From b77d155dd3fa721f82d414f629def7eb8f113a9e Mon Sep 17 00:00:00 2001 From: Jesper Skriver Date: Wed, 28 Mar 2001 14:13:19 +0000 Subject: [PATCH] MFC candidate. Change code from PRC_UNREACH_ADMIN_PROHIB to PRC_UNREACH_PORT for ICMP_UNREACH_PROTOCOL and ICMP_UNREACH_PORT And let TCP treat PRC_UNREACH_PORT like PRC_UNREACH_ADMIN_PROHIB This should fix the case where port unreachables for udp returned ENETRESET instead of ECONNREFUSED Problem found by: Bill Fenner Reviewed by: jlemon --- sys/netinet/ip_icmp.c | 2 +- sys/netinet/tcp_subr.c | 3 ++- sys/netinet/tcp_timewait.c | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 95b7197beaaf..ddb95f01edc0 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -339,7 +339,7 @@ icmp_input(m, off, proto) */ case ICMP_UNREACH_PROTOCOL: case ICMP_UNREACH_PORT: - code = PRC_UNREACH_ADMIN_PROHIB; + code = PRC_UNREACH_PORT; break; case ICMP_UNREACH_NET_PROHIB: diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 8f339e4487a0..2afff532c449 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -987,7 +987,8 @@ tcp_ctlinput(cmd, sa, vip) if (cmd == PRC_QUENCH) notify = tcp_quench; - else if (icmp_may_rst && cmd == PRC_UNREACH_ADMIN_PROHIB && ip) + else if (icmp_may_rst && (cmd == PRC_UNREACH_ADMIN_PROHIB || + cmd == PRC_UNREACH_PORT) && ip) notify = tcp_drop_syn_sent; else if (cmd == PRC_MSGSIZE) notify = tcp_mtudisc; diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 8f339e4487a0..2afff532c449 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -987,7 +987,8 @@ tcp_ctlinput(cmd, sa, vip) if (cmd == PRC_QUENCH) notify = tcp_quench; - else if (icmp_may_rst && cmd == PRC_UNREACH_ADMIN_PROHIB && ip) + else if (icmp_may_rst && (cmd == PRC_UNREACH_ADMIN_PROHIB || + cmd == PRC_UNREACH_PORT) && ip) notify = tcp_drop_syn_sent; else if (cmd == PRC_MSGSIZE) notify = tcp_mtudisc;