From patchwork Tue Dec 18 18:01:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 640 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director9.mail.ord1d.rsapps.net ([172.28.255.1]) by backend30.mail.ord1d.rsapps.net with LMTP id OEmtOhLRGVyxQgAAIUCqbw for ; Wed, 19 Dec 2018 00:03:14 -0500 Received: from director6.mail.ord1c.rsapps.net ([172.28.255.1]) by director9.mail.ord1d.rsapps.net with LMTP id sCSbOhLRGVzWcAAAalYnBA ; Wed, 19 Dec 2018 00:03:14 -0500 Received: from smtp39.gate.ord1c ([172.28.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by director6.mail.ord1c.rsapps.net with LMTP id GOFdOhLRGVyGHQAA5akwjA ; Wed, 19 Dec 2018 00:03:14 -0500 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp39.gate.ord1c.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=unstable.cc X-Suspicious-Flag: YES X-Classification-ID: 621b58be-034b-11e9-a6dd-5452006c005a-1-1 Received: from [216.105.38.7] ([216.105.38.7:64334] helo=lists.sourceforge.net) by smtp39.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 59/41-01556-211D91C5; Wed, 19 Dec 2018 00:03:14 -0500 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1gZTzj-00009I-Pi; Wed, 19 Dec 2018 05:02:07 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1gZTzi-00009B-No for openvpn-devel@lists.sourceforge.net; Wed, 19 Dec 2018 05:02:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=6TfUA9pa7BG/vNsiLWj0NvJ+luh7dUzHOQJzVHh0xJU=; b=AdRbnncU9NdrvQmgRPEMNKzUMd EWthjs9AyyrHjur/vyhjYcq8dujWEjv/39iSf0mlsLf9tebr/PQyxQxFbD1wyLtOg5jv/uD3cwBmP AL+aWpWV3RPi+ewUjczTIg9y+/ZL6VLa1y+41crL2jFod22LpCHkB5UaOPOmP2e5/Mhk=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=6TfUA9pa7BG/vNsiLWj0NvJ+luh7dUzHOQJzVHh0xJU=; b=L BNkIZToCWWL4hzVroZXqWDDUW3OJltin/k1jp9l2Wmj3DJurbn3u1P6dt+7UKExZ26wxson9l+T8I g4/hujQsi3LvtiOqi635lR6TgTqy3Ec2ZBy5Tc7LYF2mtDXOj8IQ9fZP2yazbi0AOEt2upfd22B/h 42sOnsxA4kJpwiPI=; Received: from s2.neomailbox.net ([5.148.176.60]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1gZTzg-007Vc3-DW for openvpn-devel@lists.sourceforge.net; Wed, 19 Dec 2018 05:02:06 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Wed, 19 Dec 2018 15:01:11 +1000 Message-Id: <20181219050118.6568-1-a@unstable.cc> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [5.148.176.60 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1gZTzg-007Vc3-DW Subject: [Openvpn-devel] [PATCH v3 0/7] introduce networking API and add netlink support for Linux X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox From a high level description of this patchset, please refer to "[PATCH 0/4] add netlink support for Linux" sent to the mailing list on Apr, 20th 2018. Changes from v2: - addressed some of Arne's comments sent to the mailing list - renamed networking_ip.* to networking_iproute2.* - fixed minor bugs discovered during the integration with OVPN3 Changes from v1: - introduced opaque context object containing implementation specific state; - fixed env passed to ip command (thanks to opaque context); - rebased on to pof latest master (00d78cd5) Regards, Antonio Quartulli (7): implement networking API for iproute2 introduce sitnl: Simplified Interface To NetLink tun.c: use new networking API to handle tun interface on Linux route.c: use new networking API to handle routing table on Linux route.c: use sitnl to implement get_default_gateway_ipv6() unit tests: implement test for sitnl travis.yml: add test for iproute2 net implementation .travis.yml | 3 + configure.ac | 15 +- src/openvpn/Makefile.am | 2 + src/openvpn/errlevel.h | 1 + src/openvpn/forward.c | 2 +- src/openvpn/init.c | 55 +- src/openvpn/init.h | 5 +- src/openvpn/networking.h | 8 +- src/openvpn/networking_iproute2.c | 385 ++++++ src/openvpn/networking_iproute2.h | 36 + src/openvpn/networking_sitnl.c | 1228 ++++++++++++++++++++ src/openvpn/networking_sitnl.h | 28 + src/openvpn/openvpn.c | 4 +- src/openvpn/openvpn.h | 2 + src/openvpn/options.c | 10 +- src/openvpn/options.h | 1 + src/openvpn/route.c | 497 +++----- src/openvpn/route.h | 26 +- src/openvpn/sitnl.h | 217 ++++ src/openvpn/ssl.c | 2 +- src/openvpn/ssl_common.h | 1 + src/openvpn/tun.c | 233 ++-- src/openvpn/tun.h | 14 +- tests/Makefile.am | 3 +- tests/t_net.sh | 180 +++ tests/unit_tests/openvpn/Makefile.am | 30 +- tests/unit_tests/openvpn/test_networking.c | 229 ++++ 27 files changed, 2707 insertions(+), 510 deletions(-) create mode 100644 src/openvpn/networking_iproute2.c create mode 100644 src/openvpn/networking_iproute2.h create mode 100644 src/openvpn/networking_sitnl.c create mode 100644 src/openvpn/networking_sitnl.h create mode 100644 src/openvpn/sitnl.h create mode 100755 tests/t_net.sh create mode 100644 tests/unit_tests/openvpn/test_networking.c