From owner-freebsd-current@FreeBSD.ORG Tue Sep 26 10:28:21 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A751916A416 for ; Tue, 26 Sep 2006 10:28:21 +0000 (UTC) (envelope-from rrs@cisco.com) Received: from sj-iport-1.cisco.com (sj-iport-1-in.cisco.com [171.71.176.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6962943D5C for ; Tue, 26 Sep 2006 10:27:16 +0000 (GMT) (envelope-from rrs@cisco.com) Received: from sj-dkim-3.cisco.com ([171.71.179.195]) by sj-iport-1.cisco.com with ESMTP; 26 Sep 2006 03:27:16 -0700 Received: from sj-core-5.cisco.com (sj-core-5.cisco.com [171.71.177.238]) by sj-dkim-3.cisco.com (8.12.11.20060308/8.12.11) with ESMTP id k8QARGvn020906; Tue, 26 Sep 2006 03:27:16 -0700 Received: from xbh-sjc-211.amer.cisco.com (xbh-sjc-211.cisco.com [171.70.151.144]) by sj-core-5.cisco.com (8.12.10/8.12.6) with ESMTP id k8QARF1E021404; Tue, 26 Sep 2006 03:27:15 -0700 (PDT) Received: from xfe-sjc-212.amer.cisco.com ([171.70.151.187]) by xbh-sjc-211.amer.cisco.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 26 Sep 2006 03:27:14 -0700 Received: from [127.0.0.1] ([171.68.225.134]) by xfe-sjc-212.amer.cisco.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 26 Sep 2006 03:27:14 -0700 Message-ID: <45190062.6090306@cisco.com> Date: Tue, 26 Sep 2006 06:26:42 -0400 From: Randall Stewart User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050920 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ian FREISLICH References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 26 Sep 2006 10:27:14.0528 (UTC) FILETIME=[558B7E00:01C6E156] DKIM-Signature: a=rsa-sha1; q=dns; l=1120; t=1159266436; x=1160130436; c=relaxed/simple; s=sjdkim3002; h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version; d=cisco.com; i=rrs@cisco.com; z=From:Randall=20Stewart=20 |Subject:Re=3A=20Anyone=20play=20with=20divert=20sockets=20lately?; X=v=3Dcisco.com=3B=20h=3D501uzIGYshBKoQ9c94cTaL/zwjI=3D; b=t63pGjjowAO5WYazaaTADgDRBRurf8RC5jFJg5VRbeMi2lhEtFvk/PBihCgMztLObk5ravA1 hd2vAl8DtHSJoNyiJrVmEI2z510Gd3HxWjTNZz2AdnkRoha9u0l3RMxU; Authentication-Results: sj-dkim-3.cisco.com; header.From=rrs@cisco.com; dkim=pass ( sig from cisco.com verified; ); Cc: freebsd-current@freebsd.org Subject: Re: Anyone play with divert sockets lately? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Sep 2006 10:28:21 -0000 Ian FREISLICH wrote: > > > I'm using divert sockets extensively for some tunnel/vpn software > I wrote _way_ back. It's running fine on -CURRENT (Tue Sep 19 > 08:33:01 SAST 2006), 4.11-STABLE, and just about everything in > between. I've not had to change the code substantially to make it > work on newer BSDs. All our VoIP goes through this piece of code: > > memset(&from, '\0', sizeof from); > from.sin_addr.s_addr = INADDR_ANY; > from.sin_port = config.tuns[config.tun].fw_rule; > while (tot + ntohs(hdr->length) <= (p - buf + in)) { > out = sendto(config.tuns[config.tun].div_fd, buf + tot, > ntohs(hdr->length), 0, (struct sockaddr *)&from, > sizeof(addr)); > ... > > Well, its interesting ... 6.1 appears to work.. but 7.0 does not.. Now I don't think the code we have does anything with setting the sin_port like you do (to config.tuns[]...) Maybe thats the issue... Not sure... I will have to go back and look at the code :-0 R -- Randall Stewart NSSTG - Cisco Systems Inc. 803-345-0369 815-342-5222 (cell)