~ubuntu-branches/ubuntu/wily/net-snmp/wily-proposed

« back to all changes in this revision

Viewing changes to agent/mibgroup/if-mib/data_access/interface.c

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-06-28 14:59:36 UTC
  • mfrom: (1.2.3 upstream) (1.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20100628145936-cbiallic69pn044g
Tags: 5.4.3~dfsg-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Set Ubuntu maintainer address.
  - net-snmp-config: Use bash. (LP: #104738)
  - Removed multiuser option when calling update-rc.d. (LP: #254261)
  - debian/snmpd.init: LSBify the init script.
  - debian/patches/52_fix_snmpcmd_1_typo.patch: Adjust a typo in snmpcmd.1
    (LP: #250459)
  - debian/snmpd.postinst: source debconf before doing work, LP: #589056
  - debian/snmp.preinst, debian/snmp.prerm: kill any/all processes owned by
    snmp user before install/uninstall, LP: #573391
  - Add apport hook (LP: #533603):
  - debian/{snmp,snmpd}.apport: Added.
  - debian/control: Build-depends on dh-apport.
  - debian/rules: 
    + Add --with apport.
    + override_dh_apport to install hook on snmpd package only.
 * Dropped patches:
   - debian/patches/99-fix-ubuntu-div0.patch: Fix dvision by zero.. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *  Interface MIB architecture support
3
3
 *
4
 
 * $Id: interface.c 16830 2008-02-22 23:52:33Z hardaker $
 
4
 * $Id: interface.c 17263 2008-10-16 09:56:01Z jsafranek $
5
5
 */
6
6
#include <net-snmp/net-snmp-config.h>
7
7
#include <net-snmp/net-snmp-includes.h>
469
469
        if (index != tmp) {
470
470
            static int logged = 0;
471
471
            if (!logged) {
472
 
                snmp_log(LOG_ERR, "IfIndex of an interface changed. Such " \
473
 
                         "interfaces will appear multiple times in IF-MIB.\n");
 
472
                snmp_log(LOG_ERR, "IfIndex of an interface changed.\n");
474
473
                logged = 1;
475
474
            }
476
 
            DEBUGMSGTL(("access:interface:ifIndex", "index %d != tmp for %s\n",
477
 
                         index, name));
 
475
            se_remove_value_from_slist("interfaces", name);
 
476
            se_add_pair_to_slist("interfaces", strdup(name), index);
 
477
            DEBUGMSGTL(("access:interface:ifIndex", "ifname %s, old index %d, already existing, replaced with %d\n", name, tmp, index));
478
478
        }
479
479
}
480
480
 
665
665
        entry->speed = 4000000;
666
666
    else
667
667
        entry->speed = 0;
 
668
    entry->speed_high = entry->speed / 1000000LL;
668
669
}
669
670
 
670
671
netsnmp_conf_if_list *
702
703
        netsnmp_access_interface_entry_overrides_get(entry->name);
703
704
    if (if_ptr) {
704
705
        entry->type = if_ptr->type;
705
 
        entry->speed = if_ptr->speed;
 
706
        if (if_ptr->speed > 0xffffffff) {
 
707
            entry->speed = 0xffffffff;
 
708
        } else {
 
709
            entry->speed = if_ptr->speed;
 
710
        }
 
711
        entry->speed_high = if_ptr->speed / 1000000LL;
706
712
    }
707
713
}
708
714
 
747
753
        config_perror("Out of memory");
748
754
        return;
749
755
    }
750
 
    if_new->speed = strtoul(speed, &ecp, 0);
 
756
    if_new->speed = strtoull(speed, &ecp, 0);
751
757
    if (*ecp) {
752
758
        config_perror("Bad SPEED value");
753
759
        free(if_new);