diff options
author | Joachim Tingvold <joachim@tingvold.com> | 2017-04-09 01:05:42 +0200 |
---|---|---|
committer | Joachim Tingvold <joachim@tingvold.com> | 2017-04-09 01:05:42 +0200 |
commit | 717d9ba4de9a7d5eeeb59633a1f144087e8aeda2 (patch) | |
tree | ce490f7ae83274ebd0d1c54f464c522aa6f986d6 | |
parent | bce204e6241e1944941551aa21c74ae52396d44a (diff) |
Only match one of the classes (not both at the same time).
-rwxr-xr-x | bootstrap/make-dhcpd.pl | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/bootstrap/make-dhcpd.pl b/bootstrap/make-dhcpd.pl index 579a64e..812ed96 100755 --- a/bootstrap/make-dhcpd.pl +++ b/bootstrap/make-dhcpd.pl @@ -215,16 +215,24 @@ set hostmac = concat ( suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware,6,1))),2) ); +# extract only the OUI-part +set ouimac = substring(hostmac, 0, 8); + # only allow FAP "clients" class "fap-vendor-class" { # Vendor-Class Option 60, length 21: "Juniper-ex2200-48t-4g" # Vendor-Class Option 60, length 21: "Juniper-ex3300-48p" - match if substring (option vendor-class-identifier, 0, 10) = "Juniper-ex"; + match if substring(option vendor-class-identifier, 0, 10) = "Juniper-ex"; log( info, concat( "FAP: ", hostmac, " (", option host-name, ") - ", option agent.circuit-id, " - ", option vendor-class-identifier )); } class "fap-mac" { # some Juniper switches won't send vendor-class-identifier - match if binary-to-ascii(16,8,":",substring(hardware, 1, 3)) = "44:f4:77"; + match if not exists vendor-class-identifier + and ( + ( ouimac = "44:f4:77" ) or + ( ouimac = "f0:1c:2d" ) + ); + log( info, concat( "FAP: ", hostmac, " (", option host-name, ") - ", option agent.circuit-id )); } |