From patchwork Thu Feb 7 14:49:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov via arch-projects X-Patchwork-Id: 993 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id 60E5AB4FE84E for ; Thu, 7 Feb 2019 14:49:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on apollo X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00=-1, DKIMWL_WL_HIGH=-0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3, T_DMARC_POLICY_NONE=0.01 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-BL-Results: [127.0.9.2] [127.0.0.11] Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Thu, 7 Feb 2019 14:49:24 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 0AD8F1077A83B9; Thu, 7 Feb 2019 14:49:23 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [IPv6:2a01:4f8:160:3033::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS; Thu, 7 Feb 2019 14:49:22 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id D7114207A5; Thu, 7 Feb 2019 14:49:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=luna2; t=1549550962; bh=WdA9zJphh7AnMqfTc57HniVDS1U8bjs2AqH2hKUxhus=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc; b=mvUMJY1r9fEJotkpwFlp37+6+3P204bYuyGVKWYJ2015yAAuX23tR5thrz0KCqp2O VmUOEHiuPVdwWXuNctiTiVGfCvTysL+qpjmRV7XvrUwOyodrgbJ0UINVt+l2BN/O8W EB+7rnBJ3z+bqYfN6qj/6g2wfvD4ckGfuJ2C2ODehM8P5+/tE3Hysx21b2WsoPdWo+ 8nF1qpwmmbf/uq2w13/OxMxTM9Dmhyzty+VJxiIGmb51tU7UpPVGiiQlOjNuHq3K7G eFbr+4E0bDXOqFCCI0ySs+9YoDUTvwaz6yUbWTXTitiSdKInEnKRfuLSLpnbA4hkVZ FqLk6MKPHUrvykFYZrq3ZIckNrXM3wZ0depQifTDUbBKf8Qp9e1dzWwxcuKIVnFj00 w+Gdm5NU/mg5QshX2BB+0hsNQq2FIVFuqgh9YGlUOyeMvX/dqKk0/7/EeiiBEX5HSN 1yCOLKaIXJGQK2FXMrLMaX6WUV69Wjupwb1Pev+CNkm0LhJaz+YK5lLevkUfziAIVg mJ2+M6sInKZGXec9ScrBNYPsZhgLdlAUIkHGDQuSm0tMsvw4PBg6qkS/9MV+7RzVAM SDCGIp5unlz2wJomNrKF+Hy3ZtannrKLiF+YmYkL3dTt5W36K6moB9iFgc4Q2r9IH5 e747TRcPEdQ4h/GLs/54YYNE= Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id DBF0420785 for ; Thu, 7 Feb 2019 14:49:19 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by luna.archlinux.org (Postfix) with ESMTPS for ; Thu, 7 Feb 2019 14:49:19 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 17C0D1077A83B4 for ; Thu, 7 Feb 2019 14:49:18 +0000 (UTC) Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Thu, 7 Feb 2019 14:49:18 +0000 (UTC) Received: by mail-ed1-x542.google.com with SMTP id o10so31325edt.13 for ; Thu, 07 Feb 2019 06:49:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=G3eOOrVQqhj1gDgNCBEP9IMFA3l8bkd8qcIR9EJKV5I=; b=R3tpRn+/T9Y5acN6YoWiJIOnx4lmqclo68gNBe6N+yPwVg+fbX9B+Z3IgxVtNDFvhz h09lwsJpzk4oVJV0AaHhqSse6xdtoRaUup0bJQFUOjEwwpFi63+2j4+DHyyaheGDXH7R /g1QFrsJU+FOvUBLqKwkBpQfjMqq4HDKAozGJl2eql2m8kCntxYryXceddf5bEPln4i/ XXE4SmLnJ8wkyPa2tGpCWUN42DCL4XxHXcLwSxzrl0Mh7mjdAu8ytaIDoZ7Yaa8UPaBu Lp6ryRilFWjsL88lTSwkWtcd94APLz8U5P4z+NZYhB4+PGmJb/rcK0gsVP4YRZ/0AHfz fzYQ== X-Gm-Message-State: AHQUAuYrXawWFQ2ziI4OqKMTGu5vodROp/kuxvZSErr1IBqIYDuErYn7 nChnEnP/Q4+m2fCmAc7nKFaRqDG2 X-Google-Smtp-Source: AHgI3IY/sgK38mD4x+m3IZ6/yvgoKQt6dJwmn722LGhQkOZNqUkJZ7J+Ovr9haWRLnM5nrDojySIkw== X-Received: by 2002:a50:b837:: with SMTP id j52mr12966688ede.73.1549550956973; Thu, 07 Feb 2019 06:49:16 -0800 (PST) Received: from Mindship-03 (ip5653397a.direct-adsl.nl. [86.83.57.122]) by smtp.gmail.com with ESMTPSA id j22sm403996eja.42.2019.02.07.06.49.16 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 07 Feb 2019 06:49:16 -0800 (PST) Date: Thu, 7 Feb 2019 15:49:08 +0100 To: arch-projects@archlinux.org Message-ID: <20190207144908.GA19849@Mindship-03> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.11.3 (2019-02-01) Subject: [arch-projects] [netctl][PATCH] Do not allow the kernel to try and be smarter than us X-BeenThere: arch-projects@archlinux.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Arch Linux projects development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jouke Witteveen via arch-projects Reply-To: Arch Linux projects development discussion Cc: Jouke Witteveen Errors-To: arch-projects-bounces@archlinux.org Sender: "arch-projects" When accept_ra is set to 1, router advertisements are still ignored if the interface is in forwarding mode. For such configurations, the interface should have a static configuration and netctl already sets accept_ra to 0. Setting it to 2 otherwise forces the kernel to accept router advertisements regardless of the forwarding setting. --- src/lib/ip | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/ip b/src/lib/ip index 65057ab..e3f6a2f 100644 --- a/src/lib/ip +++ b/src/lib/ip @@ -50,13 +50,16 @@ ip_set() { dhcp|dhcp-noaddr|stateless|static) [[ -d "/proc/sys/net/ipv6" ]] || modprobe ipv6 sysctl -q -w "net.ipv6.conf.$interface_sysctl.disable_ipv6=0" - [[ $IP6 == "static" ]] - sysctl -q -w "net.ipv6.conf.$interface_sysctl.accept_ra=$?" + if [[ $IP6 == "static" ]]; then + sysctl -q -w "net.ipv6.conf.$interface_sysctl.accept_ra=0" + else # Accept router advertisements regardless of the forwarding setting + sysctl -q -w "net.ipv6.conf.$interface_sysctl.accept_ra=2" + fi ;; no) [[ -d "/proc/sys/net/ipv6" ]] && sysctl -q -w "net.ipv6.conf.$interface_sysctl.disable_ipv6=1" ;; - "") # undefined IP6 does not prevent RA's from being received -> nop + "") # Having IP6= unset does not prevent router advertisements from being received ;; *) report_error "IP6 must be 'dhcp', 'dhcp-noaddr', 'stateless', 'static' or 'no'"