From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <201002231229.13030.articice@ua.fm> References: <201002231229.13030.articice@ua.fm> Date: Tue, 23 Feb 2010 10:27:51 -0800 Message-ID: Subject: Re: [9fans] pppoe on Plan 9 From: Russ Cox To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Topicbox-Message-UUID: d905be02-ead5-11e9-9d60-3106f5b1d025 >> it looks like in pppoe.c the block >> >> =C2=A0 =C2=A0 =C2=A0 if((s =3D findtag(pkt, TagSrvName, &len, 0)) =3D=3D= nil) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return bad("no matching= service name"); >> =C2=A0 =C2=A0 =C2=A0 if(len !=3D strlen(srvname) || memcmp(s, srvname, l= en) !=3D 0) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return bad("no matching= service name"); >> >> should be inside a if(srvname[0] !=3D '\0') { ... }. > > this is because the PPPoE RFC defines strings "provider name/access > concentrator" and "service name" in service offer packets, in case you ha= ve > lots of providers and different connections in your network. The services= may > include different payment packages, special line for voip/video, a VPN, e= tc. > Offers are collected after a request broadcast. i understand the protocol. but if there is no -S option given, the current code waits for an offer with service name =3D=3D "". that's silly. it should take the first one it gets. russ