]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2796] compare with Opcode object instead of a numeric code
authorYoshitaka Aharen <aharen@jprs.co.jp>
Thu, 6 Jun 2013 05:16:30 +0000 (14:16 +0900)
committerYoshitaka Aharen <aharen@jprs.co.jp>
Thu, 6 Jun 2013 05:16:30 +0000 (14:16 +0900)
src/bin/auth/statistics.cc.pre

index ec39db6a4ae43866269615859f4e146e5fce7dd7..14341fe5f52a561a0b7944a10f50dc012524cf18 100644 (file)
@@ -138,11 +138,9 @@ Counters::incRequest(const MessageAttributes& msgattrs) {
     // if a short message which does not contain DNS header is received, or
     // a response message (i.e. QR bit is set) is received.
     if (opcode) {
-        const int code = opcode.get().getCode();
-        server_msg_counter_.inc(opcode_to_msgcounter[code]);
+        server_msg_counter_.inc(opcode_to_msgcounter[opcode->getCode()]);
 
-        // Opcode = 0: Query
-        if (code == Opcode::QUERY_CODE) {
+        if (opcode.get() == Opcode::QUERY()) {
             // Recursion Desired bit
             if (msgattrs.requestHasRD()) {
                 server_msg_counter_.inc(MSG_QRYRECURSION);