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=QyLJP3Kf; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id 6E9015A004C for ; Mon, 21 Oct 2024 20:11:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729534302; 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=rhivfYIX7HBiivRzhU2SE8djHucqXBEF6MZary4QTAs=; b=QyLJP3KfUJT5Psv6Qj7Sl+lzVjGH9GY+/W8iqXYTEOBQo08ml+y0pOMt6URhxOp6m+JFyg SnSDvIPcJphdJN/NbiNzqlJUsPyGrpMR6evInNTtSJyBi5at2NVQSNxhSMMG1JcuhHOZOb 8YlotRNdhmctj25t7EGmlLKMVMMZJM4= Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-479-zj1AMX3BOuOmXxg9pbkyqw-1; Mon, 21 Oct 2024 14:11:38 -0400 X-MC-Unique: zj1AMX3BOuOmXxg9pbkyqw-1 Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-7ea999a79a2so5457452a12.2 for ; Mon, 21 Oct 2024 11:11:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729534295; x=1730139095; 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=rhivfYIX7HBiivRzhU2SE8djHucqXBEF6MZary4QTAs=; b=Z0ge5ViIEBpT8wIuUTvVk2eZNuZA5+5oV74AmUOosEnLOyfyTiL9axN8zytGol/BL+ Yl11IQZ6/Nwk40OVoZGhMsMPGoylw4G4gDtKrgYj14QRpu5jXGPQh/shyF5adRvccn+n 8sxaW1QX4vjxYly0V9AnGat9aM1MTwKHbPfhFwJh7Tx+8mUt+9DwhMSpESxMRISfmEGP JLZHfqgW1BQg1uTSwrkX23/WucS8BGSVA2NOAyCrm94NoBDJZp8zpfNRebTeOSjlfT5s L5tq4BU83RTROUFwqEp50fHhACMV5Oad/oWR9u2fu1PW8Y3A6MLHrwlu2ORW0dO0tUj7 PDUQ== X-Gm-Message-State: AOJu0Yw/yPQr8Aex0aJV2yBoL/byuclAWwEMGVAKJwVWx6dKZkhH3IW8 DVjpKVUZTtmt+pIVv8mRPFbM5plARfulcics7zWwlySZzFTFRakOcCX9860qbYZDslwpHxmBSA1 b/WTsGsHOajZ7JwxL6tEEr9yAmez/aCHzsubso45z7/pwh/3r4UfcLvklqQ== X-Received: by 2002:a05:6a21:9201:b0:1d8:aa64:874f with SMTP id adf61e73a8af0-1d92c5bdb06mr17288336637.43.1729534295305; Mon, 21 Oct 2024 11:11:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHRySic+T49dZh6BAJbxXNLFre8mWBI6Tw+3J3wOMC5RKwJ71nrFAkSU4met5QK80NiPssYSQ== X-Received: by 2002:a05:6a21:9201:b0:1d8:aa64:874f with SMTP id adf61e73a8af0-1d92c5bdb06mr17288306637.43.1729534294902; Mon, 21 Oct 2024 11:11:34 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71ec1407da1sm3185416b3a.191.2024.10.21.11.11.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2024 11:11:32 -0700 (PDT) Date: Mon, 21 Oct 2024 20:11:29 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH] tcp: Use structures to construct initial TCP options Message-ID: <20241021201129.6291b2d2@elisabeth> In-Reply-To: <20241021074029.2271142-1-david@gibson.dropbear.id.au> References: <20241021074029.2271142-1-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-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: SDRPEJY6YTYJPED7TEJRXC3WGPQUB2HN X-Message-ID-Hash: SDRPEJY6YTYJPED7TEJRXC3WGPQUB2HN 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 Mon, 21 Oct 2024 18:40:29 +1100 David Gibson wrote: > As a rule, we prefer constructing packets with matching C structures, > rather than building them byte by byte. However, one case we still build > byte by byte is the TCP options we include in SYN packets (in fact the only > time we generate TCP options on the tap interface). > > Rework this to use a structure and initialisers which make it a bit > clearer what's going on. > > Signed-off-by: David Gibson Applied. By the way, since you were wondering: I originally added the NOP option before the MSS option simply because the Linux kernel does that as well: typically, "SACK Permitted" and "Timestamps" (12 bytes altogether, hence aligned) come first, then NOP, then MSS. -- Stefano