From owner-freebsd-net@FreeBSD.ORG Tue Dec 16 06:52:28 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 249ED1065676 for ; Tue, 16 Dec 2008 06:52:28 +0000 (UTC) (envelope-from dustah@gmail.com) Received: from mail-bw0-f14.google.com (mail-bw0-f14.google.com [209.85.218.14]) by mx1.freebsd.org (Postfix) with ESMTP id 515ED8FC17 for ; Tue, 16 Dec 2008 06:52:27 +0000 (UTC) (envelope-from dustah@gmail.com) Received: by bwz7 with SMTP id 7so7321529bwz.19 for ; Mon, 15 Dec 2008 22:52:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=TADDnKCTKfNAu/GMAYj+LOd4wY6l3ABe9ijMbg7ySAU=; b=GJA6k8aHieLMLgMiGnUVVw72g+6jFEHgvpfpW/1iy/b3A1In+5Ch7nLYVKW5RRuvUa iE8HSJQOt4OS80woJiDzZToFF3FDFfKI3bb+llOdJlw3DrEAC0CpPoquFn1U0P9IhIVY Eh09tJK3b0oPLMnlvsiUfWzdvXZ/8vG67P22M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=fOXtGlNkReLZa8EVXt4CVaIFXQNKYz/eM2CWriNukHaAVtPXaa975Ttrr85+Pbc7DU BRBFoVV9qpQVJ6ENV7UlmZDvg6i91IKRrm6vYQdNhcWXvz+3n5kD8lGTka02KVuvn+Jc 9f+rGQ7ZnZIGbc99cWvaPEwNOm8Ucfaq6hn3A= Received: by 10.223.103.212 with SMTP id l20mr7577173fao.3.1229410345634; Mon, 15 Dec 2008 22:52:25 -0800 (PST) Received: by 10.223.126.15 with HTTP; Mon, 15 Dec 2008 22:52:25 -0800 (PST) Message-ID: Date: Tue, 16 Dec 2008 09:52:25 +0300 From: "Denis Mysenko" To: freebsd-net@freebsd.org In-Reply-To: <200812151112.59847.max@love2party.net> MIME-Version: 1.0 References: <200812151112.59847.max@love2party.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: PPP / Routing table X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2008 06:52:28 -0000 On Mon, Dec 15, 2008 at 1:12 PM, Max Laier wrote: > > It is also unclear to me why you'd see RTF_GATEWAY on ptp routes. It might > help to ktrace poptop to see what kind of ioctl it is issuing. > > Actually, as far as I understand (and according to kdump as well) - Poptop has nothing to do with interfaces or VPN itself - Poptop simply connects userland ppp with connected users, the rest is the task of ppp. So either this is a problem of ppp or OS/kernel. So I did ktrace on ppp, ppp reads ppp.secret file to get necessary IP address and issues the following call: CALL ioctl(0x1,SIOCAIFADDR, 0xbfbfdaac) And also these two calls: CALL __sysctl(0xbfbfda50,0x6,0,0xbfbfda78,0,0) CALL __sysctl(0xbfbfda50,0x6,0x8127800,0xbfbfda78,0,0) At the end of the link establishment process, ppp also issues these two calls: CALL ioctl(0x1,SIOCGIFFLAGS,0xbfbfdf8c) CALL ioctl(0x1,SIOCSIFFLAGS,0xbfbfdf8c) I compared two ktrace log files - from successful and from unsuccessful VPN connections and these ioctl() calls are equal. I ran through sources of ppp, these calls are issued by ipip.c and iface.c - initially to set up interface and then to change it's flags. Interface is chosen correctly for these calls. Another interesting thing, probably related to the last two calls, is when the second client connects to the Poptop server, initial routing table of FreeBSD contains a good entry with correct tunnel interface and UH flags, then entry flags are updated to UGH, then entry interface is updated to incorrect tunnel of the previous client. Just a note - ppp.log contains correct tunnel interfaces for all clients, as well as correct IP addresses in IPCP part. -- Sincerely, -- Denis Mysenko, CCNA, MCP, MCSA Technologies of the Smart City Ltd Phone: +7 903 913-2651 ICQ: 555955