snmp/snmp_agentx.patch

Fri, 07 Sep 2012 19:08:07 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 07 Sep 2012 19:08:07 +0200
changeset 667
9dacbd1d1aa2
permissions
-rw-r--r--

Correct build configuration in Solaris subdir, correct english grammar,
remove irrelevant strip notice, introduce custom CFLAG logic, facilitate
use of Solaris Studio compiler with needed build configuration
adjustments, conditionally build 64 bit position independent code,
and accommodate tun(7) in newer Solaris releases by renaming driver
and module from conflicting 'tun' to 'vtun'. These changes include
some nonstandard 'I give up' logic causing out of tree builds by
manipulating the PATH, for example.

     1 diff Nau agent/snmp_agent.c.orig agent/snmp_agent.c
     2 Index: agent/snmp_agent.c
     3 --- agent/snmp_agent.c.orig
     4 +++ agent/snmp_agent.c
     5 @@ -1535,38 +1535,42 @@ int
     6  netsnmp_remove_delegated_requests_for_session(netsnmp_session *sess)
     7  {
     8      netsnmp_agent_session *asp;
     9 -    int count = 0;
    10 -    
    11 -    for (asp = agent_delegated_list; asp; asp = asp->next) {
    12 -        /*
    13 -         * check each request
    14 -         */
    15 -        netsnmp_request_info *request;
    16 -        for(request = asp->requests; request; request = request->next) {
    17 -            /*
    18 -             * check session
    19 -             */
    20 -            netsnmp_assert(NULL!=request->subtree);
    21 -            if(request->subtree->session != sess)
    22 -                continue;
    23 +    int count;
    25 +    do {
    26 +        count = 0;
    27 +        for (asp = agent_delegated_list; asp; asp = asp->next) {
    28              /*
    29 -             * matched! mark request as done
    30 +             * check each request
    31               */
    32 -            netsnmp_request_set_error(request, SNMP_ERR_GENERR);
    33 -            ++count;
    34 +            netsnmp_request_info *request;
    35 +            for(request = asp->requests; request; request = request->next) {
    36 +                /*
    37 +                 * check session
    38 +                 */
    39 +                netsnmp_assert(NULL!=request->subtree);
    40 +                if(request->subtree->session != sess)
    41 +                    continue;
    42 +
    43 +                /*
    44 +                 * matched! mark request as done
    45 +                 */
    46 +                netsnmp_request_set_error(request, SNMP_ERR_GENERR);
    47 +                ++count;
    48 +            }
    49          }
    50 -    }
    52 -    /*
    53 -     * if we found any, that request may be finished now
    54 -     */
    55 -    if(count) {
    56 -        DEBUGMSGTL(("snmp_agent", "removed %d delegated request(s) for session "
    57 -                    "%8p\n", count, sess));
    58 -        netsnmp_check_outstanding_agent_requests();
    59 -    }
    60 -    
    61 +        /*
    62 +         * if we found any, that request may be finished now
    63 +         */
    64 +        if(count) {
    65 +            DEBUGMSGTL(("snmp_agent", "removed %d delegated request(s) for session "
    66 +                        "%8p\n", count, sess));
    67 +            netsnmp_check_outstanding_agent_requests();
    68 +            /* the request may get delegated if it was GETNEXT, retry the loop */
    69 +        }
    70 +    } while (count);
    71 +
    72      return count;
    73  }

mercurial