From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=RWh3XriE; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 908445A0276 for ; Wed, 19 Feb 2025 07:56:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739948201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8rGH+zq/72L/HnLLrAbKA6eGkBtKAS2SO3horhR4tbk=; b=RWh3XriEbr0cClXU65F7QIgpcQX0gMzWgia9F70wUjFC44Psjm2c0FFUuyPNtpIlEhMXrm Pc8/J6C0BqudQ1lOWLFLRue3+wL4IEYd95kiBY4MOSY1C9QjQVZdp8XY7cCvn8Jklkssoh mo2wkBt8VkMjXdkYWqqPxH7wbNCFdgs= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-58-x88-LCZPMdu3bW56mONl5A-1; Wed, 19 Feb 2025 01:56:39 -0500 X-MC-Unique: x88-LCZPMdu3bW56mONl5A-1 X-Mimecast-MFC-AGG-ID: x88-LCZPMdu3bW56mONl5A_1739948199 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-38f4e47d0b2so1053098f8f.2 for ; Tue, 18 Feb 2025 22:56:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739948198; x=1740552998; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=8rGH+zq/72L/HnLLrAbKA6eGkBtKAS2SO3horhR4tbk=; b=UVgYf+JOMaVcIhSpviGGPdbGecCtOE4WmwtGucjhVpoJkDrNbNhzJDUqpS5YrVQzij 24pDH6/9a3o5CFMMD8ssRl54HiPa9Ghqn9fhJHv/v2Y+xLZqaYuv+Rsqdmn7v8RNGQLV ofXLAnXksi52xAGtJWNQs26dLbIqvkXkNOZ5VUT7xPEQFKNJSDdpJ37MU8fu25W3Bz+n bh2IDPLXr/1OsvpZURzjrOBO9zaqHRXop4olkZ6WK6Cc5m0J/S6xc/LXZv6ncAUeDf6n eSdJEZ5Bkm/cTapfsciVTIf6uEb4qbPr9R790YgJ94MiVZ5CvYy4Idk6y4rqzAARp5sw I8MA== X-Gm-Message-State: AOJu0YyZbnc2o9MCJS/XO7swTKYeUrAq/bNzW+MaFq9FkQp3tdbVYLyY SccwlLmFpeKed3XFxj92DnNFZHFRBon728C8D++o6rptn/6dG84Q4tIjOC9cRxS7KYvxTNz5F9t M8GR+1EKuh5LGLbbTx+7U+ZUmMMPMnOYX5xvc0/NcEeZ19SOmmqAK4SrWpw== X-Gm-Gg: ASbGncslOkO3MuWFj7S0367QojCi1Rlga8PI68aCgG7OoKRb6FUDEjdSdcGwnXbQBWZ LRX83lyjn5NrH2OobJQko4fudpFQ+Vfg4Ov5T4yPR8MrltexvuNB+NemUEtCWP4mc5JdLjhCyWA JF6TQskDrFjndnrjoxvzs2tj/p23dLTASaoCVbMJYqT5q14YvkSC0VBogl2KPdWOe0SFJT5ornL 5BEkch4A3mXnjxpIifaqbgOZHQeLZ+D5rRicp1qFx4MNY62hQEccyJXkfv+If6j36SRfJJiqJGK +p8yGQk1z3ar50+e X-Received: by 2002:adf:e98f:0:b0:38f:2678:d790 with SMTP id ffacd0b85a97d-38f587ac38cmr1511196f8f.33.1739948198477; Tue, 18 Feb 2025 22:56:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IFfUsPlLYSZN4IACvPKyS9lD+Wxy91o51dbMD8+u+2O3yT7PqGJh9Pj9aj04ByHFl6iKYj9WA== X-Received: by 2002:adf:e98f:0:b0:38f:2678:d790 with SMTP id ffacd0b85a97d-38f587ac38cmr1511184f8f.33.1739948198103; Tue, 18 Feb 2025 22:56:38 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38f258ccdabsm16956450f8f.28.2025.02.18.22.56.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2025 22:56:37 -0800 (PST) Date: Wed, 19 Feb 2025 07:56:36 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 1/3] conf: More thorough error checking when parsing --mtu option Message-ID: <20250219075636.68df99aa@elisabeth> In-Reply-To: <20250219031429.3708026-2-david@gibson.dropbear.id.au> References: <20250219031429.3708026-1-david@gibson.dropbear.id.au> <20250219031429.3708026-2-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: AsF17ZhAg1k-De7yvofA7PtptR7rehzXoUbmx7I0H6k_1739948199 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: IUCALXAMNO3CDVOEVS5BRFZTHIEUR5YT X-Message-ID-Hash: IUCALXAMNO3CDVOEVS5BRFZTHIEUR5YT X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed, 19 Feb 2025 14:14:27 +1100 David Gibson wrote: > We're a bit sloppy with parsing MTU which can lead to some surprising, > though fairly harmless, results: > * Passing a non-number like '-m xyz' will not give an error and act like > -m 0 > * Junk after a number (e.g. '-m 1500pqr') will be ignored rather than > giving an error > * We parse the MTU as a long, then immediately assign to an int, so on > some platforms certain ludicrously out of bounds values will be > silently truncated, rather than giving an error > > Be a bit more thorough with the error checking to avoid that. > > Signed-off-by: David Gibson Applied. -- Stefano