From patchwork Mon Jun 24 17:05:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Claudi X-Patchwork-Id: 1121449 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=fail (p=none dis=none) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 45XbJr4N8dz9s3l for ; Tue, 25 Jun 2019 03:05:32 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732088AbfFXRFa (ORCPT ); Mon, 24 Jun 2019 13:05:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36576 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726920AbfFXRFa (ORCPT ); Mon, 24 Jun 2019 13:05:30 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5D7653007149; Mon, 24 Jun 2019 17:05:30 +0000 (UTC) Received: from renaissance-vector.mxp.redhat.com (unknown [10.32.181.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E7B1600C0; Mon, 24 Jun 2019 17:05:29 +0000 (UTC) From: Andrea Claudi To: netdev@vger.kernel.org Cc: stephen@networkplumber.org, dsahern@kernel.org Subject: [PATCH iproute2 0/3] do not set IPv6-only options on IPv4 addresses Date: Mon, 24 Jun 2019 19:05:52 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 24 Jun 2019 17:05:30 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 'home', 'nodad' and 'mngtmpaddr' options are IPv6-only, but it is possible to set them on IPv4 addresses, too. This should not be possible. Fix this adding a check on the protocol family before setting the flags, and exiting with invarg() on error. Andrea Claudi (3): ip address: do not set nodad option for IPv4 addresses ip address: do not set home option for IPv4 addresses ip address: do not set mngtmpaddr option for IPv4 addresses ip/ipaddress.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)