From patchwork Tue Apr 3 15:39:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Nault X-Patchwork-Id: 894658 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=alphalink.fr Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40FtZY6kBLz9ryk for ; Wed, 4 Apr 2018 01:40:05 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752220AbeDCPkC (ORCPT ); Tue, 3 Apr 2018 11:40:02 -0400 Received: from zimbra.alphalink.fr ([217.15.80.77]:50310 "EHLO zimbra.alphalink.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751410AbeDCPkA (ORCPT ); Tue, 3 Apr 2018 11:40:00 -0400 Received: from localhost (localhost [127.0.0.1]) by mail-2-cbv2.admin.alphalink.fr (Postfix) with ESMTP id 34A512B52114; Tue, 3 Apr 2018 17:39:59 +0200 (CEST) Received: from zimbra.alphalink.fr ([127.0.0.1]) by localhost (mail-2-cbv2.admin.alphalink.fr [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id ADn35W6DkubB; Tue, 3 Apr 2018 17:39:54 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail-2-cbv2.admin.alphalink.fr (Postfix) with ESMTP id 9BAEB2B5205E; Tue, 3 Apr 2018 17:39:54 +0200 (CEST) X-Virus-Scanned: amavisd-new at mail-2-cbv2.admin.alphalink.fr Received: from zimbra.alphalink.fr ([127.0.0.1]) by localhost (mail-2-cbv2.admin.alphalink.fr [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id UGrMCnnAJpyN; Tue, 3 Apr 2018 17:39:54 +0200 (CEST) Received: from c-dev-0.admin.alphalink.fr (94-84-15-217.reverse.alphalink.fr [217.15.84.94]) by mail-2-cbv2.admin.alphalink.fr (Postfix) with ESMTP id 673892B52045; Tue, 3 Apr 2018 17:39:54 +0200 (CEST) Received: by c-dev-0.admin.alphalink.fr (Postfix, from userid 1000) id 3559E6026E; Tue, 3 Apr 2018 17:39:54 +0200 (CEST) Date: Tue, 3 Apr 2018 17:39:54 +0200 From: Guillaume Nault To: netdev@vger.kernel.org Cc: James Chapman , Stephen Hemminger Subject: [PATCH iproute2] ip/l2tp: remove offset and peer-offset options Message-ID: <46d360e852235de84e44c796fa934f9cfce988b1.1522769819.git.g.nault@alphalink.fr> MIME-Version: 1.0 Content-Disposition: inline X-Mutt-Fcc: =Sent User-Agent: Mutt/1.9.4 (2018-02-28) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Ignore options "peer-offset" and "offset" when creating sessions. Keep them when dumping sessions in order to avoid breaking external scripts. "peer-offset" has always been a noop in iproute2. "offset" is now ignored in Linux 4.16 (and was broken before that). Signed-off-by: Guillaume Nault --- ip/ipl2tp.c | 23 ++++------------------- man/man8/ip-l2tp.8 | 16 ---------------- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/ip/ipl2tp.c b/ip/ipl2tp.c index 750f912a..427e0249 100644 --- a/ip/ipl2tp.c +++ b/ip/ipl2tp.c @@ -42,8 +42,6 @@ struct l2tp_parm { uint32_t peer_tunnel_id; uint32_t session_id; uint32_t peer_session_id; - uint32_t offset; - uint32_t peer_offset; enum l2tp_encap_type encap; uint16_t local_udp_port; uint16_t peer_udp_port; @@ -174,8 +172,6 @@ static int create_session(struct l2tp_parm *p) if (p->reorder_timeout) addattr64(&req.n, 1024, L2TP_ATTR_RECV_TIMEOUT, p->reorder_timeout); - if (p->offset) - addattr16(&req.n, 1024, L2TP_ATTR_OFFSET, p->offset); if (p->cookie_len) addattr_l(&req.n, 1024, L2TP_ATTR_COOKIE, p->cookie, p->cookie_len); @@ -310,8 +306,8 @@ static void print_session(struct l2tp_data *data) print_string(PRINT_FP, NULL, "%s", _SL_); } - print_uint(PRINT_ANY, "offset", " offset %u,", p->offset); - print_uint(PRINT_ANY, "peer_offset", " peer offset %u\n", p->peer_offset); + print_uint(PRINT_ANY, "offset", " offset %u,", 0); + print_uint(PRINT_ANY, "peer_offset", " peer offset %u\n", 0); if (p->cookie_len > 0) print_cookie("cookie", "cookie", @@ -362,8 +358,6 @@ static int get_response(struct nlmsghdr *n, void *arg) p->pw_type = rta_getattr_u16(attrs[L2TP_ATTR_PW_TYPE]); if (attrs[L2TP_ATTR_ENCAP_TYPE]) p->encap = rta_getattr_u16(attrs[L2TP_ATTR_ENCAP_TYPE]); - if (attrs[L2TP_ATTR_OFFSET]) - p->offset = rta_getattr_u16(attrs[L2TP_ATTR_OFFSET]); if (attrs[L2TP_ATTR_DATA_SEQ]) p->data_seq = rta_getattr_u16(attrs[L2TP_ATTR_DATA_SEQ]); if (attrs[L2TP_ATTR_CONN_ID]) @@ -550,7 +544,6 @@ static void usage(void) " tunnel_id ID\n" " session_id ID peer_session_id ID\n" " [ cookie HEXSTR ] [ peer_cookie HEXSTR ]\n" - " [ offset OFFSET ] [ peer_offset OFFSET ]\n" " [ seq { none | send | recv | both } ]\n" " [ l2spec_type L2SPEC ]\n" " ip l2tp del tunnel tunnel_id ID\n" @@ -678,19 +671,11 @@ static int parse_args(int argc, char **argv, int cmd, struct l2tp_parm *p) invarg("invalid option for udp6_csum_tx\n" , *argv); } else if (strcmp(*argv, "offset") == 0) { - __u8 uval; - + fprintf(stderr, "Ignoring option \"offset\"\n"); NEXT_ARG(); - if (get_u8(&uval, *argv, 0)) - invarg("invalid offset\n", *argv); - p->offset = uval; } else if (strcmp(*argv, "peer_offset") == 0) { - __u8 uval; - + fprintf(stderr, "Ignoring option \"peer_offset\"\n"); NEXT_ARG(); - if (get_u8(&uval, *argv, 0)) - invarg("invalid offset\n", *argv); - p->peer_offset = uval; } else if (strcmp(*argv, "cookie") == 0) { int slen; diff --git a/man/man8/ip-l2tp.8 b/man/man8/ip-l2tp.8 index 8ce630a6..9aba6bec 100644 --- a/man/man8/ip-l2tp.8 +++ b/man/man8/ip-l2tp.8 @@ -59,12 +59,6 @@ ip-l2tp - L2TPv3 static unmanaged tunnel configuration .br .RB "[ " seq " { " none " | " send " | " recv " | " both " } ]" .br -.RB "[ " offset -.IR OFFSET -.RB " ] [ " peer_offset -.IR OFFSET -.RB " ]" -.br .ti -8 .BR "ip l2tp del tunnel" .B tunnel_id @@ -285,16 +279,6 @@ Default is .br Valid values are: .BR none ", " send ", " recv ", " both "." -.TP -.BI offset " OFFSET" -sets the byte offset from the L2TP header where user data starts in -transmitted L2TP data packets. This is hardly ever used. If set, the -value must match the peer_offset value used at the peer. Default is 0. -.TP -.BI peer_offset " OFFSET" -sets the byte offset from the L2TP header where user data starts in -received L2TP data packets. This is hardly ever used. If set, the -value must match the offset value used at the peer. Default is 0. .SS ip l2tp del session - destroy a session .TP .BI tunnel_id " ID"