From nobody Fri May 28 21:40:26 2021 X-Original-To: freebsd-net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6692FDB95A8 for ; Fri, 28 May 2021 21:40:30 +0000 (UTC) (envelope-from bakul@iitbombay.org) Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FsJ594n6wz4my1 for ; Fri, 28 May 2021 21:40:29 +0000 (UTC) (envelope-from bakul@iitbombay.org) Received: by mail-ot1-x32a.google.com with SMTP id u25-20020a0568302319b02902ac3d54c25eso4835289ote.1 for ; Fri, 28 May 2021 14:40:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iitbombay-org.20150623.gappssmtp.com; s=20150623; h=from:mime-version:subject:message-id:date:to; bh=0A4MgaRmWUHNKl70azkxmlRxCI+jW9GWS0MXM2KPIis=; b=XJCReu1kWNkZUB6fTvBD+k1617WZNw4OqSOsx6Y9JBzOevtjLTE+oTmt8SNJ5hGthH xmX6eox6RaDWEDPZiKYS6xszZy2ETl9zsogOIN1x43tl+WGMWCUqqsQp1E4ZJfC+cGkx zW1SIoDE1dLYxzAl+YG86wOnNNw4ZE1Xz+S4+o2H1NBH/KzRiCZBJzEI413CJ/yOkU9q Q/Bumm7v979N0ZBroklK20hHIOw905nKmTU9xPaQ6oZsJhaimtx4j6Fkt0XaKcAF173N cuwzxCBa2na1I3OVeZtb6st4nP9cIMSCeBCORbR++xE0QkPIStv2fd8uwhHF0QU0c/VX uXpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=0A4MgaRmWUHNKl70azkxmlRxCI+jW9GWS0MXM2KPIis=; b=U+x8Lvj0ZqFEz17O7hQvuB/l1bUBgveN3KDBl8mqbRlExhtIgq+tNO2n463ZnHkomt ehKJ0K1WkkuQQ3ATIKrBU+M7klORU9kJBo0UfKGPd46uVCyfRfefN3fS1YthBqlP4TKq VLKR3tbg1DTHU3vUh4mBRy7HlgnE+8Fz63aOKes1UjKTb7hQsD0WcSRswItU9jz4RuM/ XkkX061DhM5w4/DZQTJCzn8zuhiWLaH4PgQQCSi6UR1bM97U0QPHY1C3aNDEj9BwA92A 3SBBwi1pKFCd1WK67Yjo0E+rTQ7WNZ9scE8IPTR6+aF97BDFqkxMHltmLT5OqVdJZDeU Hflg== X-Gm-Message-State: AOAM5313DZSiaAWs46lhytmEgdbdmjbT/WdVTY8yaDldDHOHGVex+4ur yM9azcayZZuDGdn5lhaBoZpQSiZNvxSNHRUy X-Google-Smtp-Source: ABdhPJztkk/odOm6rwojlY/hyX2p6EonONa9i3Dzi47lcKilecmXqaj2uJkk/iWpxUk6/pb9o0//vA== X-Received: by 2002:a9d:4911:: with SMTP id e17mr8802827otf.38.1622238028047; Fri, 28 May 2021 14:40:28 -0700 (PDT) Received: from smtpclient.apple (107-215-223-229.lightspeed.sntcca.sbcglobal.net. [107.215.223.229]) by smtp.gmail.com with ESMTPSA id z9sm1367097oti.37.2021.05.28.14.40.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 May 2021 14:40:27 -0700 (PDT) From: Bakul Shah Content-Type: multipart/alternative; boundary="Apple-Mail=_4D4E7E14-7192-483F-AD71-C5F2492D91AA" List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.80.0.2.43\)) Subject: bind(2) fails on 13.0-STABLE when sin_family is 0 Message-Id: Date: Fri, 28 May 2021 14:40:26 -0700 To: freebsd-net@freebsd.org X-Mailer: Apple Mail (2.3654.80.0.2.43) X-Rspamd-Queue-Id: 4FsJ594n6wz4my1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=iitbombay-org.20150623.gappssmtp.com header.s=20150623 header.b=XJCReu1k; dmarc=none; spf=pass (mx1.freebsd.org: domain of bakul@iitbombay.org designates 2607:f8b0:4864:20::32a as permitted sender) smtp.mailfrom=bakul@iitbombay.org X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[iitbombay-org.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::32a:from]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[iitbombay-org.20150623.gappssmtp.com:s=20150623]; FREEFALL_USER(0.00)[bakul]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; DMARC_NA(0.00)[iitbombay.org]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::32a:from:127.0.2.255]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::32a:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-net] X-ThisMailContainsUnwantedMimeParts: Y --Apple-Mail=_4D4E7E14-7192-483F-AD71-C5F2492D91AA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii ttcp runs fine on 13.0-RELEASE but fails on -stable. The culprit seems to be bind(2). Running ttcp under gdb: $ gdb a.out Reading symbols from a.out... (gdb) b 295 Breakpoint 1 at 0x203127: file ttcp.c, line 295. (gdb) run -s -r Starting program: /usr/ports/benchmarks/ttcp/work/ttcp-1.12_2/a.out -s = -r ttcp-r: buflen=3D8192, nbuf=3D2048, align=3D16384/0, port=3D5001 tcp ttcp-r: socket Breakpoint 1, main (argc=3D3, argv=3D0x7fffffffd9b0) at ttcp.c:295 295 if (bind(fd, (struct sockaddr *) &sinme, sizeof(sinme)) = < 0) (gdb) p/x sinme $1 =3D {sin_len =3D 0x0, sin_family =3D 0x0, sin_port =3D 0x8913, = sin_addr =3D { s_addr =3D 0x0}, sin_zero =3D {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, = 0x0}} (gdb) n 296 err("bind"); (gdb) p errno $2 =3D 47 $ errno 47 #define EAFNOSUPPORT 47 /* Address family not supported = by protocol family */ Did something change post 13.0-RELEASE that requires specifying = sin_family? Thanks! -- Bakul --Apple-Mail=_4D4E7E14-7192-483F-AD71-C5F2492D91AA--