X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:content-type :content-transfer-encoding:mime-version; q=dns; s=default; b=RFH ygRr2TD3s4XBh1GjLmmzIkFNR7WmuliqQ9KBUMmDSL+YGcIixYHCTmFYyQ2NevbB 9sjcmZxxvQxJvGi37BgR5pwbQYJi3j0xjdlFDHms9gcuIBr0DS+m6Jchb+q9lstl GzpkBtrn8B3tSXQAlbRGtfbxPCbYuLpVtJSjM3NU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:content-type :content-transfer-encoding:mime-version; s=default; bh=VnKXKtRyq 6gcmvwC+EsT2t9TSYo=; b=CGh7qbs5EjfDJmVVukQsALLu8XPi3YYvkY5Q4fsnd qDAkjrgD/aMRZmpIMPlB4tjO08d7wzzrGRZeOlHG6ixdEsMKUGr2eEMCzLEdbB+K g3h5TcdxrFV7uic9jNzs7GEm1Ri4IaUYjXq0P0oH4izKUMmoMl+j9BuSxzdfJDvh XE= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.0 required=5.0 tests=BAYES_00,FORGED_HOTMAIL_RCVD2,FREEMAIL_FROM,GIT_PATCH_1,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=adapter, UD:hotmail.com, hotmailcom, hotmail.com X-HELO: NAM04-SN1-obe.outbound.protection.outlook.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VuNtiV4IUGEZnz+QJK35QVt6OqGrX5r87R8cwlDyrPoPh7XG3pzvkn/7YnnL4CgBZacH2Wb/KxwPFSvRSza+NYyVaFRd81TarFZHEq9+i59Gftwc0g8NKKFnNqk7FDkiNBFgrlNwIM9ulAEE0Wex7vqGlpijGAQ3IP73HfN78QqHJVJ6FLDN3YTKTN2fpT6xlrpFjWfStYkF3o8YJYDQqn9T8HlxB144QkVE6DWnuzndMU3XdSqC74KLWaREtJURSYMt0zu9ExG6zzKzzCc+fDIfWoB+17564L8I8Enr+G6hIpo4CK/IPR4gZ1/dEi/qMzKRsKv7UYWS8v8QWcVnqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fIxqu5QLqK4k3UmeTH23RcL2P0unGRDCPwMq4kEvWGk=; b=njm4Nvy3lr5XdhTNId6VTxgKIKOC8FOW7huE4NaQQT5VQ9OeHwjgW8YZ7uRXE+d63aPrjwY8zJnjwzoAc9QxBKulWbFWJvD5mOW7N6PU9lA0bnmuSWh2cdQ3kN9+j4kh/YOq0MpBpgDqwrkdkU60qKavAbCOw0h5tgehYGYkCgfHdOYQ1gGfQuAQ0Oiy5NYAjq/gTp9M9MkwJvo9xSoaJ8wbihw14uStJ9+QBhriYigIQepYgLgXzqra9vZsInRgwaJ3POzXgcBcQk23stDhGjt5QNT9SR56jRUuN49jRLq1euXHcuKObBvYT4s82bWkU8bKmYF1/Y5gO7ollqFuKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fIxqu5QLqK4k3UmeTH23RcL2P0unGRDCPwMq4kEvWGk=; b=rv/pBgERmPGU3x6ItjDo1fVsDx9mN6DsTJRspBLtljeTNvV01UtzB/3N3NaH/JhuhtsvBld5HUE2c92dWZYbYl/p3ssUPhWypbGTwKS7MwsZF3jwLZbArki3bNeol5cqavKB8QnJUAd4eHu8nENWu6jf8d3tcvh9U+Rt8XwRKd23DJMqYoPjkh8p71UsRMvH/reIL8mXMoZixS491y70oc+RbqrzOlotEbd/FWATZL+1FLEbFuPGYPeXeAk8X8yKPt4KSc9w/As6IRBU5CqjoxqJ9mshQMRwSdf8bdqfCs4AtiEocrSd57MTaYAYJzg6ShktDVFJFRT2BkOOb11ENA== From: David Bean To: "cygwin AT cygwin DOT com" Subject: Possible bug retrieving IfIndex in newlib - winsup/cygwin/net.cc Date: Tue, 22 Oct 2019 15:56:17 +0000 Message-ID: x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id x9MFurEd014632 Good Day, I have been working on porting Samba 4.11 to Cygwin for a few days and ran into an odd issue. Samba configures its interfaces in several steps, but it relies pretty heavily on getting information from the interface structures populated by Cygwin. While I was walking through the call map I noticed a lot of the data is populated by get_ifs and that routine may have a bug in its handling of IfIndex. Basically it seems to copy the IPv4 index at all times even though it may need Ipv6Index. the same code exists at line 1904 and 1808 as well. I believe the current code may fail to retrieve the correct adapter index if IPv6 is enabled on the interface. this is current code: ifp->ifa_hwdata.ifa_ifindex = pap->IfIndex; I think it should be: ifp->ifa_hwdata.ifa_ifindex = (sa->sa_family == AF_INET ? pap->IfIndex : pap->Ipv6Index); This is the model used by the lines retrieving the other elements with dual locations on the windows side. I am unable to debug this to confirm it, but please let me know if this is actually a bug or not. Sincerely, David Bean -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple