~ubuntu-branches/debian/lenny/net-snmp/lenny

« back to all changes in this revision

Viewing changes to agent/mibgroup/header_complex.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2007-05-10 22:20:23 UTC
  • Revision ID: james.westby@ubuntu.com-20070510222023-3fr07xb9i17xvq32
Tags: upstream-5.3.1
ImportĀ upstreamĀ versionĀ 5.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
365
365
                               oid * newoid, size_t newoid_len, void *data)
366
366
{
367
367
    struct header_complex_index *hciptrn, *hciptrp, *ourself;
 
368
    int rc;
368
369
 
369
370
    if (thedata == NULL || newoid == NULL || data == NULL)
370
371
        return NULL;
371
372
 
372
373
    for (hciptrn = *thedata, hciptrp = NULL;
373
 
         hciptrn != NULL; hciptrp = hciptrn, hciptrn = hciptrn->next)
 
374
         hciptrn != NULL; hciptrp = hciptrn, hciptrn = hciptrn->next) {
374
375
        /*
375
376
         * XXX: check for == and error (overlapping table entries) 
 
377
         * 8/2005 rks Ok, I added duplicate entry check, but only log
 
378
         *            warning and continue, because it seems that nobody
 
379
         *            that calls this fucntion does error checking!.
376
380
         */
377
 
        if (snmp_oid_compare
378
 
            (hciptrn->name, hciptrn->namelen, newoid, newoid_len)
379
 
            > 0)
 
381
        rc = snmp_oid_compare(hciptrn->name, hciptrn->namelen,
 
382
                              newoid, newoid_len);
 
383
        if (rc > 0)
380
384
            break;
 
385
        else if (0 == rc) {
 
386
            snmp_log(LOG_WARNING, "header_complex_add_data_by_oid with "
 
387
                     "duplicate index.\n");
 
388
            /** uncomment null return when callers do error checking */
 
389
            /** return NULL; */
 
390
        }
 
391
    }
381
392
 
382
393
    /*
383
394
     * nptr should now point to the spot that we need to add ourselves