From owner-freebsd-net@freebsd.org Tue Oct 1 08:17:49 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3CAAA12FF49 for ; Tue, 1 Oct 2019 08:17:49 +0000 (UTC) (envelope-from luthramihir708@gmail.com) Received: from mail-ua1-x92d.google.com (mail-ua1-x92d.google.com [IPv6:2607:f8b0:4864:20::92d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 46jBwD12lTz4Z7R for ; Tue, 1 Oct 2019 08:17:47 +0000 (UTC) (envelope-from luthramihir708@gmail.com) Received: by mail-ua1-x92d.google.com with SMTP id l13so5148888uap.8 for ; Tue, 01 Oct 2019 01:17:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=2SHTn7r1CquuoR6CpXeTZ8Dpicn3Dc9ElZm33dY/kek=; b=cZ0MRy6OiUC8SijBtwBY+m+aYlDwOdesEjcZ29iImCj/o7+38M4Oba6pFdnCsHOXn9 6L15TT7V41gPDaVmhrIrK5gWX0kVOt/NHkkU0/EnRIWbF8OHHt3TCt+T7u/djCx7Xa8n Ha6INAzO2OPZjYCY0VvKj4xQ2QCRzL0JZkwy3kN6CY+Z33YYfxJ9ieFp4eEiIJaQ+w25 78kZtLZJGDitotLOSnDr7SqzjpdJGQla3Asv72AF6FnkEPKBaS5ioUUa49prRWMmS9PS PXfJ76T2h9ykL8dsydPsLmSUKwEZ23lx2Sk8OtRH4svYdGFcfmqlWUQ1F0z1shu7utIh Lkjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=2SHTn7r1CquuoR6CpXeTZ8Dpicn3Dc9ElZm33dY/kek=; b=VtX/e1IFVI2qbGyy7w7sbXVZjXBZSiaGTqQcWBQWYxZkXZWSop4ScBPIrwTUO4v+5L fYHKx+qoohwIzL9g3pjPR2VDZ4CTXta5rYUHJIy2AMURDBY3rNSV6RMsJdGYVvP1qa9q H7bZzgDdNGbxtnGREzAhR6eaNX9vUdG6qFXymwPpJSfqNd1NUjns5tjnKsYM6Rl6GHv1 fwR/NzAS8qBByHBYNXk0y9WwCSay7GOgvJ3a1iYxwwlWk5gJIV6DanEH7N6fcLjYssdN FHh5RGuD3TXh3ZSeJbhAh+bVA4Yy0O9gkw+D3+6k+Ei+Qaksz1MVijXK4cJNfC2F04x7 UbkQ== X-Gm-Message-State: APjAAAWN86FQryL4FTYtJDw1xuaWyGbxGx/9rbmdmA9kOhNxTnxdKNCn 8DRv2fW5xDpuIS3dKyfmAFNgpY64YdLgWPtd/jXVilC2 X-Google-Smtp-Source: APXvYqxHbM8WxGcn1ATvYJMLbEqQTId1Uv7rbuJbeN/l1+Iolcl7e6G6Qx+2GG/JbAkpXK+bnt8VPsXBNK13k5L/zFE= X-Received: by 2002:ab0:b06:: with SMTP id b6mr13635166uak.78.1569917866378; Tue, 01 Oct 2019 01:17:46 -0700 (PDT) MIME-Version: 1.0 From: Mihir Luthra Date: Tue, 1 Oct 2019 13:47:35 +0530 Message-ID: Subject: best way to reveive both ipv4 and ipv6 connections To: freebsd-net X-Rspamd-Queue-Id: 46jBwD12lTz4Z7R X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=cZ0MRy6O; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of luthramihir708@gmail.com designates 2607:f8b0:4864:20::92d as permitted sender) smtp.mailfrom=luthramihir708@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; URI_COUNT_ODD(1.00)[3]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(0.00)[ip: (-9.04), ipnet: 2607:f8b0::/32(-2.58), asn: 15169(-2.16), country: US(-0.05)]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[d.2.9.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2019 08:17:49 -0000 Hi everyone, I was working on making rwhod ipv6 clean. I have done some work so far but then I realised I can't receive ipv4 connections on AF_INET6 sockets. On googling I found its insecure and freebsd disables it by default. [1] I needed some advice on what would be the best way to receive connections then? Should I use 2 separate sockets with conditions? [1] https://security.stackexchange.com/questions/92081/is-receiving-ipv4-connections-on-af-inet6-sockets-insecure Kind Regards, Mihir