Date: Mon, 4 Jan 1999 15:20:13 +0200 (EET) From: Ruslan Ermilov <ru@ucb.crimea.ua> To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: kern/9309: [PATCH] ip_divert.c bug Message-ID: <199901041320.PAA05806@relay.ucb.crimea.ua>
next in thread | raw e-mail | index | archive | help
>Number: 9309 >Category: kern >Synopsis: [PATCH] ip_divert.c bug >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Jan 4 05:30:01 PST 1999 >Closed-Date: >Last-Modified: >Originator: Ruslan Ermilov >Release: FreeBSD 2.2.8-STABLE i386 >Organization: United Commercial Bank >Environment: Kernel built with divert(4) support. >Description: Attempt to write the packet as incoming to the divert socket, with sin_port set to the rule number and interface supplied in sin_addr, rather than in sin_zero[], causes EADDRNOTAVAIL error. The problem first appeared in revision 1.1.2.12, when the following line of code was deleted (by Julian Elischer): sin->sin_port = 0; The removal of this line causes ifa_ifwithaddr() to fail when sin_port is set to any non-zero value. >How-To-Repeat: I have a small program, which can be used to implement IP over UDP tunneling (http://www.ucb.crimea.ua/~ru/FreeBSD/). It worked fine until 2.2.7. It uses old logic, i.e. sin_port is used to avoid firewall checker loops. Now it fails with ``Can't assing requested address'' when trying to write an incoming packet to the divert socket. Thanks to: kseel <kseel@utcorp.com>, who pointed out the problem. >Fix: Try the following patch (both RELENG_2_2 and HEAD): Index: ip_divert.c =================================================================== RCS file: /usr/FreeBSD-CVS/src/sys/netinet/ip_divert.c,v retrieving revision 1.1.2.12 diff -u -r1.1.2.12 ip_divert.c --- ip_divert.c 1998/07/06 08:48:38 1.1.2.12 +++ ip_divert.c 1999/01/04 12:48:00 @@ -317,6 +317,7 @@ struct ifaddr *ifa; /* If no luck with the name above, check by IP address. */ + sin->sin_port = 0; if (m->m_pkthdr.rcvif == NULL) { if (!(ifa = ifa_ifwithaddr((struct sockaddr *) sin))) { error = EADDRNOTAVAIL; >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?199901041320.PAA05806>