{"record":{"id":"dbfea8b9c9fc6a1e","repo":"theforeman/foreman","slug":"invalid-mac-mac","errorCode":null,"errorMessage":"Invalid MAC #{mac}","messagePattern":"Invalid MAC #(.+?)","errorType":"validation","errorClass":"Net::Validations::Error","httpStatus":null,"severity":"error","filePath":"app/lib/net/validations.rb","lineNumber":87,"sourceCode":"\n    def self.multicast_mac?(mac)\n      return false unless validate_mac(mac)\n\n      # Get the first byte\n      msb = mac.tr('.:-', '').slice(0..1).to_i(16)\n\n      # Is least significant bit set?\n      msb & 0b1 == 1\n    end\n\n    def self.broadcast_mac?(mac)\n      return false unless validate_mac(mac)\n      mac.downcase == 'ff:ff:ff:ff:ff:ff'\n    end\n\n    # validates the mac and raises an error\n    def self.validate_mac!(mac)\n      raise Error, \"Invalid MAC #{mac}\" unless validate_mac(mac)\n      mac\n    end\n\n    # validates the hostname\n    def self.validate_hostname(hostname)\n      HOST_REGEXP.match?(hostname)\n    end\n\n    # validates the hostname and raises an error\n    def self.validate_hostname!(hostname)\n      raise Error, \"Invalid hostname #{hostname}\" unless validate_hostname(hostname)\n      hostname\n    end\n\n    def self.validate_network(network)\n      validate_ip(network)\n    end\n","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/theforeman/foreman/blob/6b05625475cfe6aac31a88f8c8ee6e62e4efe620/app/lib/net/validations.rb#L69-L105","documentation":"Error \"Invalid MAC #{mac}\" thrown in theforeman/foreman.","triggerScenarios":"Thrown at app/lib/net/validations.rb:87 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6b05625475cfe6aac31a88f8c8ee6e62e4efe620","analyzedAt":"2026-08-23T17:46:34.094Z","schemaVersion":2},"datasetVersion":"2026-08-23T21:17:23.414Z"}