Vendor Class ID - Option 43 Parsing Issue

Peter Rathlev peter at rathlev.dk
Fri Jul 19 07:57:29 UTC 2013


On Wed, 2013-07-17 at 21:25 +0000, Keith Perry (perryk) wrote:
> class "pre30eCM"  {
>   match if (option vendor-class-identifier = "docsis 1.0"
>   or option vendor-class-identifier = "docsis1.0")
>   or substring (option vendor-class-identifier, 0, 10) = "docsis1.1:"
>   or substring (option vendor-class-identifier, 0, 10) = "docsis2.0:"
>   and option SA.devtype = "ECM";                          
> }
...
> class "pre30CM"  {
>   match if option vendor-class-identifier = "docsis 1.0"
>   or substring (option vendor-class-identifier, 0, 10) = "docsis1.1:"
>   or substring (option vendor-class-identifier, 0, 10) = "docsis2.0:"
>   and not (option SA.devtype = "ECM");
> }

Wouldn't it be prudent to insert some more parentheses? I'm not 100%
certain how dhcpd treats operator precedence but parens would remove any
confusion. Normally logical AND has higher precedence that logical OR
which means that the 'SA.devtype = "ECM"' only counts for "docsis2.0:"
modems.

The request you're showing that doesn't fall into the right group thus
matches both "pre30eCM" and "pre30CM". If your problem is that it falls
into "pre30CM" where it should fall into "pre30eCM" then the parentheses
might solve you problem.

-- 
Peter





More information about the dhcp-users mailing list