From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine 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=goTsjpG2; 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 166985A0272 for ; Wed, 16 Apr 2025 11:41:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1744796498; 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=FrnqhNrGBzOKNhpvP1Bx9t8MeIBW8ObCGCglVVJ5UVU=; b=goTsjpG25dlQepm0drT6Ll+Mt8i/80ak7a786ZPF7w2u5C/YIXJHYQEoI9kgwVu9Chb8G9 bg+sl/b47uZFYFUGkpyt/KfUR5OUYKynCq6NFwph+VN4q22j+bB/BU5DOlGMuDWO7+I4EX VV5iU8kx8czg4lWvy0oreZegTiZsMH8= 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-272-FLCxPSEuMRWBKlUodh8iww-1; Wed, 16 Apr 2025 05:41:35 -0400 X-MC-Unique: FLCxPSEuMRWBKlUodh8iww-1 X-Mimecast-MFC-AGG-ID: FLCxPSEuMRWBKlUodh8iww_1744796493 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-39131f2bbe5so2549787f8f.3 for ; Wed, 16 Apr 2025 02:41:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744796493; x=1745401293; 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=FrnqhNrGBzOKNhpvP1Bx9t8MeIBW8ObCGCglVVJ5UVU=; b=m8x/MKG2Afw8T00lFedFFL9pSg5lYnUeyyAYGPRZit8vOFhkuhNluXSO1X2tQ7bH6h eHUhp+nNq4jY+X/SEoURvO5ZM8NCFvAXDtwNIPg8BUmiit3dgMzOPgWOkf1QbYm7LTld hYen0WA8gYvEpLD5E2uKuNS7cvTkTmT3BaX//0myhBlj73A60X9U9yoSnANF515SWCv3 8N/1JKko+r9fIjTb7atqnH+hEq/TNxWmrjgel3DbqUAnWl3+t66/CvguZP+nxxdJik3M dudMLHBYsN/OjEYuuokXJsih+m/9Ngb+UDz6dZ7bBusH8rZwe6lNBVipvodSNerKRhjR XRfA== X-Forwarded-Encrypted: i=1; AJvYcCVDzb6eWT1af/dqIe35LNMx677OL/A2TJhZ1Rc8tzrdZS0kDmMhBXUe9lkJF4IeOU414Ii6gjyLvJQ=@passt.top X-Gm-Message-State: AOJu0Yy/EYUkcR45PfGgvUlx56S4GwiHei0/Cq8NN8dj51r749fsEZD4 tRqpRJMqG4yp1aOLenngbqi0ap16B+QWomN5fpvTKdv+iqT9dJxW7GvTuaF99mqBRbRPH9W2/W0 E+p/bdMdxI2ZeUoPLjzresIgC7SY0uDjT/Y/qJiPD0lRGIhhnzA== X-Gm-Gg: ASbGncuFuIfPk5SzFhlGfLfEnvBgqIDxJe5ysbiQnhZ1NLbnflNew4J/waS18Cc2DwJ zvjksCmDR5a4ELLDgwylJqi1kGg/loaYE2xUeTSjnU5HikwR3si4o5cQgW0w338Q3rEl4R55Rrs mDXzXcrsYaVRJCoTuGgWOS347QEuZHHzugbH7a4++i6kWomsURGsz1TcBn3QHC1Y2hlYJJ8NEHu 886NmsGNuU8VRuvEO0bxEuTdrPoB2hvLnXI8R1fQrkGTjsKejyNsF5NeJH/ZbUbs+ExFJsh4bWe r7+I2LLNiHY/D2BX0gxE72c= X-Received: by 2002:a5d:5f49:0:b0:390:eebc:6f32 with SMTP id ffacd0b85a97d-39ee5bade02mr1181978f8f.48.1744796493448; Wed, 16 Apr 2025 02:41:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFdXHZxSea0DFpC1kS4peNELW1Kq8YGRtfDuvYql44JyBSaYOJuxiisHxl49A80pTi+TOxaCQ== X-Received: by 2002:a5d:5f49:0:b0:390:eebc:6f32 with SMTP id ffacd0b85a97d-39ee5bade02mr1181960f8f.48.1744796493155; Wed, 16 Apr 2025 02:41:33 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39eaf44577dsm16710072f8f.94.2025.04.16.02.41.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 02:41:32 -0700 (PDT) Date: Wed, 16 Apr 2025 11:41:31 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 2/4] treewide: Improve robustness against sockaddrs of unexpected family Message-ID: <20250416114131.6592c712@elisabeth> In-Reply-To: <20250416090707.393497-3-david@gibson.dropbear.id.au> References: <20250416090707.393497-1-david@gibson.dropbear.id.au> <20250416090707.393497-3-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: OMPO_3AGxGMLEhdRK4UJFs3oAMhHaUeUQ6O5a2-bKCE_1744796493 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 357FBYFNESEZJYQ2IEL35SP4VHRKVOBC X-Message-ID-Hash: 357FBYFNESEZJYQ2IEL35SP4VHRKVOBC 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: Jon Maloy , 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, 16 Apr 2025 19:07:05 +1000 David Gibson wrote: > @@ -239,22 +239,28 @@ static inline void inany_from_af(union inany_addr *aa, > /** inany_from_sockaddr - Extract IPv[46] address and port number from sockaddr > * @aa: Pointer to store IPv[46] address > * @port: Pointer to store port number, host order > - * @addr: AF_INET or AF_INET6 socket address > + * @addr: Socket address This is actually sa_ now but... can we do something for argument names in general, here? What about dst, port, sa, or dst, port, addr? > + * > + * Return: 0 on success, -1 on error (bad address family) > */ > -static inline void inany_from_sockaddr(union inany_addr *aa, in_port_t *port, > - const union sockaddr_inany *sa) > +static inline int inany_from_sockaddr(union inany_addr *aa, in_port_t *port, > + const void *sa_) > { > + const union sockaddr_inany *sa = (const union sockaddr_inany *)sa_; -- Stefano