From owner-freebsd-ports-bugs@freebsd.org Sun Jun 19 00:27:40 2016 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 1CD67A78146 for ; Sun, 19 Jun 2016 00:27:40 +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 DF3571F2E for ; Sun, 19 Jun 2016 00:27:39 +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 u5J0Rd88071228 for ; Sun, 19 Jun 2016 00:27:39 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 210380] [patch] fix net/nload interface name fetching Date: Sun, 19 Jun 2016 00:27:39 +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: patch X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: allanjude@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ehaupt@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status keywords bug_severity priority component assigned_to reporter flagtypes.name attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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.22 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 00:27:40 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D210380 Bug ID: 210380 Summary: [patch] fix net/nload interface name fetching Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Keywords: patch Severity: Affects Many People Priority: --- Component: Individual Port(s) Assignee: ehaupt@FreeBSD.org Reporter: allanjude@FreeBSD.org Keywords: patch Assignee: ehaupt@FreeBSD.org Flags: maintainer-feedback?(ehaupt@FreeBSD.org) Created attachment 171560 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D171560&action= =3Dedit patch for net/nload net/nload gets the network interface device names via struct sockaddr_dl struct sockaddr_dl { u_char sdl_len; /* Total length of sockaddr */ u_char sdl_family; /* AF_LINK */ u_short sdl_index; /* if !=3D 0, system given index for interf= ace */ u_char sdl_type; /* interface type */ u_char sdl_nlen; /* interface name length, no trailing 0 req= d. */ u_char sdl_alen; /* link level address length */ u_char sdl_slen; /* link layer selector length */ char sdl_data[46]; /* minimum work area, can be larger; contains both if name and ll address */ }; The name is stored in sdl_data, but is no longer null terminated. The first sdl_nlen bytes are the device name, the sdl_alen bytes after that are the l= ink level address (MAC address), etc. This small patch makes nload read only the first sdl_alen bytes as the devi= ce name, instead of reading binary data as a string until it finds a null byte. This happens to often work if the first byte of the mac address is 0. before: Device alc0~P+49=E2=96=92d (1/11): Device em0h^E=C3=8A^W=C2=B7o (2/11): after: Device alc0 (1/11): Device em0 (2/11): --=20 You are receiving this mail because: You are the assignee for the bug.=