From owner-freebsd-ports-bugs@freebsd.org Tue Aug 11 17:28:04 2015 Return-Path: Delivered-To: freebsd-ports-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4384C99EF77 for ; Tue, 11 Aug 2015 17:28:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2812E272 for ; Tue, 11 Aug 2015 17:28:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id t7BHS4on073538 for ; Tue, 11 Aug 2015 17:28:04 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 202247] x11/i3status: Incorrect Ethernet status after addition of SIOCGIFXMEDIA Date: Tue, 11 Aug 2015 17:28:03 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: jhb@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bapt@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name cc attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Aug 2015 17:28:04 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202247 Bug ID: 202247 Summary: x11/i3status: Incorrect Ethernet status after addition of SIOCGIFXMEDIA Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: bapt@FreeBSD.org Reporter: jhb@FreeBSD.org Flags: maintainer-feedback?(bapt@FreeBSD.org) CC: Assignee: bapt@FreeBSD.org Created attachment 159773 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=159773&action=edit i3status_eth.patch A few months back, the media status word for Ethernet was adjusted to use several high bits to extend the subtype field. Ever since this, i3status has reported a media status string of "10GBase-KX4" when my laptop's Ethernet was unplugged. The root bug is that the loop looking for a matching subtype uses the IFM macros against the subtype's word. This is incorrect. The description tables only contain a single field in the raw word. (Note that the corresponding code in ifconfig only applies the IFM macros to the value from ifm_active.) Previously this bug didn't matter as IFM_SUBTYPE() against the values in the table was a no-op. However, with the extended types in the table, the IFM_SUBTYPE() chopped off the upper bits. This is why the first extended type (10GBase-KX4) matched a status of 0 when the interface is down. Note that I also removed the IFM_TYPE check as it was bogus. The entries in the table only have the subtype, so the IFM_TYPE is always clear. This was why IFM_TYPE_MATCH in the original source had to be hacked to permit 0 which at that point meant it was always true and a no-op. While here, I fixed a few other things: 1) added support for fetching extended media types 2) return an unknown status if the ioctl fails instead of garbage 3) return an unknown status if the type is not Ethernet 4) explicitly handle no carrier instead of falling through to returning "?" This should probably go upstream as well if possible. (I just have the patch for the port, I did not bump portrevision) -- You are receiving this mail because: You are the assignee for the bug.