From owner-freebsd-net@freebsd.org Fri Feb 12 18:08:58 2016 Return-Path: <owner-freebsd-net@freebsd.org> Delivered-To: freebsd-net@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 DF83FAA6293 for <freebsd-net@mailman.ysv.freebsd.org>; Fri, 12 Feb 2016 18:08:58 +0000 (UTC) (envelope-from pallav_bose@yahoo.com) Received: from nm49-vm6.bullet.mail.gq1.yahoo.com (nm49-vm6.bullet.mail.gq1.yahoo.com [67.195.87.236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9511888 for <freebsd-net@freebsd.org>; Fri, 12 Feb 2016 18:08:58 +0000 (UTC) (envelope-from pallav_bose@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1455300341; bh=F+F8fEkaw7m2yUoCxbEgnC2M+gN21gxfzt1vznp2IGQ=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:From:Subject; b=tmY74kI1epgWNFCUrTjG6+mJmSv0RR04OD0DJLh/JMaSz0ZMztOkNvnOnySHnyZxsMsGehpsgdPm9TncxbG5quT73wbZ2UT+vwyDrwdTTQfREsEeIFHMeODC6ef4xxwtaUT8WpgTvjoOLwzt6bDYF/iJDPEIGvflvw2wPq5vbE7RFAdRBQqW7U8kW205++r8ISwMnOo+MG38zlIXqxgO0kqX98kwlz6bkYewh06KP3D5b0yIVuFFPiCaCTqMR8sgQP9qq/AJutphJUDOjIL1+cZRTS0ke+z6wc+hiw6JWEp83fM/b6VQvXdyvvpBALCNgkzPoIstmH+IquM+MP3DCg== Received: from [127.0.0.1] by nm49.bullet.mail.gq1.yahoo.com with NNFMP; 12 Feb 2016 18:05:41 -0000 Received: from [216.39.60.180] by nm49.bullet.mail.gq1.yahoo.com with NNFMP; 12 Feb 2016 18:02:48 -0000 Received: from [98.137.12.207] by tm16.bullet.mail.gq1.yahoo.com with NNFMP; 12 Feb 2016 18:02:48 -0000 Received: from [127.0.0.1] by omp1015.mail.gq1.yahoo.com with NNFMP; 12 Feb 2016 18:02:48 -0000 X-Yahoo-Newman-Property: ymail-4 X-Yahoo-Newman-Id: 237163.74741.bm@omp1015.mail.gq1.yahoo.com X-YMail-OSG: x.CKgzkVM1kMKqdGL2e5lCRJPm8I3QuowRGWc3H.QXVcAGB6y7.DY0Zp36OO9P4 XQI9EC2IwE5DA5vXr1ocHJOq00AOq6_kvCDMubUlGAX60TBEb7bh3.mx9zkHUzpMP9lwa7rjQdEN Hxi2uNgaDuvykALhwKEdgnraXWf5ZjfplWHjm0VKpdVSY_ZmyN5kdpFQ1tte92DB2aGD9gGhNSzs gM4zjkCndVF9r00TSoQeTe4oII6cmkrcksDmDdiTIB_YM1WPZvroCUewVEziMrFXa_AguFwwywtR Re2XR_Yhy02V2TIPqzVCwVDMx2F41_SB49GMqXqZJkoqARy_8aBmgdGXoOvAb8BFPQWx1CWdn8t6 OC4tgR7bi6BCmaPM8TbkYxcOVyn9Bb4Mlf7b8rVFufN84I__KF7ZKjSHEXen.NJJCRfdB59MVXwQ l3hyezOSyx6ldX3F_5KjsAt3z8k1O3TNfTZQx0r3NnpQRP_Hlz1aORsxOWT8sRJd0vFRCcwO6fiZ GHU355k8QKQEvYaGR0FHR37omtuDTuTKMQ1bJ6rAu55xc2A-- Received: by 98.137.12.251; Fri, 12 Feb 2016 18:02:47 +0000 Date: Fri, 12 Feb 2016 18:02:47 +0000 (UTC) From: Pallav Bose <pallav_bose@yahoo.com> Reply-To: Pallav Bose <pallav_bose@yahoo.com> To: "freebsd-net@freebsd.org" <freebsd-net@freebsd.org> Cc: "rpokala@mac.com" <rpokala@mac.com> Message-ID: <604939402.3154674.1455300167449.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: <249322925.1631277.1455058288002.JavaMail.yahoo@mail.yahoo.com> References: <249322925.1631277.1455058288002.JavaMail.yahoo.ref@mail.yahoo.com> <249322925.1631277.1455058288002.JavaMail.yahoo@mail.yahoo.com> Subject: Re: C program API to determine negotiated link speed of a network interface? MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD <freebsd-net.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-net>, <mailto:freebsd-net-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/freebsd-net/> List-Post: <mailto:freebsd-net@freebsd.org> List-Help: <mailto:freebsd-net-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-net>, <mailto:freebsd-net-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 12 Feb 2016 18:08:59 -0000 Hi Ravi, That information you provided was very useful, thanks!=20 =C2=A0Regards, Pallav=20 On Tuesday, February 9, 2016 2:51 PM, Pallav Bose <pallav_bose@yahoo.co= m> wrote: =20 Hi, I'm writing a C program to list all available interfaces and their link spe= ed. I can use getifaddrs(3) to obtain a list of network interfaces in a str= uct ifaddrs, but none of the fields in this struct gives me information abo= ut the negotiated link speed. From the man page of getifaddrs(3): The ifaddrs structure contains at least the following entries: =C2=A0=C2=A0=C2=A0 =C2=A0struct=C2=A0=C2=A0=C2=A0 ifaddrs=C2=A0=C2=A0=C2=A0= *ifa_next;=C2=A0=C2=A0=C2=A0 =C2=A0 /* Pointer to next struct */ =C2=A0=C2=A0=C2=A0 =C2=A0char=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *ifa_name;=C2=A0=C2=A0=C2=A0 = =C2=A0 /* Interface name */ =C2=A0=C2=A0=C2=A0 =C2=A0u_int=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ifa_flags;=C2=A0=C2=A0=C2=A0 = =C2=A0 /* Interface flags=C2=A0=C2=A0=C2=A0 */ =C2=A0=C2=A0=C2=A0 =C2=A0struct=C2=A0=C2=A0=C2=A0 sockaddr=C2=A0 *ifa_addr;= =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0 /* Interface address */ =C2=A0=C2=A0=C2=A0 =C2=A0struct=C2=A0=C2=A0=C2=A0 sockaddr=C2=A0 *ifa_netma= sk;=C2=A0=C2=A0=C2=A0 /* Interface netmask */ =C2=A0=C2=A0=C2=A0 =C2=A0struct=C2=A0=C2=A0=C2=A0 sockaddr=C2=A0 *ifa_broad= addr;=C2=A0 /* Interface broadcast address */ =C2=A0=C2=A0=C2=A0 =C2=A0struct=C2=A0=C2=A0=C2=A0 sockaddr=C2=A0 *ifa_dstad= dr;=C2=A0=C2=A0=C2=A0 /* P2P interface destination */ =C2=A0=C2=A0=C2=A0 =C2=A0void=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *ifa_data;=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0 /* Address specific data */ Running truss on ifconfig(8) tells me that the ioctl SIOCGIFMEDIA can be us= ed, but it is not clear to me how. Is there an API in C which does this alr= eady? # truss ifconfig em0....<snipped>.... ioctl(3,SIOCGIFMAC,0xffffe210)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ERR#22 'Inv= alid argument' ioctl(3,SIOCGIFMEDIA,0xffffe1f0)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 0 (0x0) ioctl(3,SIOCGIFMEDIA,0xffffe1f0)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 0 (0x0) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 media: Ethernet autoselect (1000= baseT <full-duplex>) write(1,"\tmedia: Ethernet autoselect (10"...,54) =3D 54 (0x36) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 status: active write(1,"\tstatus: active\n",16)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 16 (0x10) Thanks,Pallav From owner-freebsd-net@freebsd.org Fri Feb 12 21:02:10 2016 Return-Path: <owner-freebsd-net@freebsd.org> Delivered-To: freebsd-net@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 94EE2AA748A for <freebsd-net@mailman.ysv.freebsd.org>; Fri, 12 Feb 2016 21:02:10 +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 86385F80 for <freebsd-net@FreeBSD.org>; Fri, 12 Feb 2016 21:02:10 +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 u1CL29kQ041577 for <freebsd-net@FreeBSD.org>; Fri, 12 Feb 2016 21:02:10 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-net@FreeBSD.org Subject: [Bug 207087] kernel: r295285 in 10.2-STABLE breaks OpenVPN functionality Date: Fri, 12 Feb 2016 21:02:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.2-STABLE X-Bugzilla-Keywords: regression X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: g_amanakis@yahoo.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: gnn@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created Message-ID: <bug-207087-2472-eV1DQWNv11@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-207087-2472@https.bugs.freebsd.org/bugzilla/> References: <bug-207087-2472@https.bugs.freebsd.org/bugzilla/> 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-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD <freebsd-net.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-net>, <mailto:freebsd-net-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/freebsd-net/> List-Post: <mailto:freebsd-net@freebsd.org> List-Help: <mailto:freebsd-net-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-net>, <mailto:freebsd-net-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 12 Feb 2016 21:02:10 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D207087 --- Comment #19 from g_amanakis@yahoo.com --- Created attachment 166908 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D166908&action= =3Dedit wan.pcap --=20 You are receiving this mail because: You are on the CC list for the bug.=