Merge branch 'V5-4-patches' into V5-5-patches
* V5-4-patches:
snmpnetstat/if.c: properly detect snmp exceptions
diff --git a/apps/snmpnetstat/if.c b/apps/snmpnetstat/if.c
index b073643..43e502d 100644
--- a/apps/snmpnetstat/if.c
+++ b/apps/snmpnetstat/if.c
@@ -267,15 +267,21 @@
while ( 1 ) {
if (netsnmp_query_getnext( var, ss ) != SNMP_ERR_NOERROR)
break;
+ if ((var->type & 0xF0) == 0x80) /* Exception */
+ break;
ifcol_oid[ ifcol_len-1 ] = 2; /* ifDescr */
if ( snmp_oid_compare( ifcol_oid, ifcol_len,
var->name, ifcol_len) != 0 )
break; /* End of Table */
+ if ((var->type & 0xF0) == 0x80) /* Exception */
+ return;
cur_if = SNMP_MALLOC_TYPEDEF( struct _if_info );
if (!cur_if)
break;
cur_if->ifindex = var->name[ var->name_length-1 ];
for ( vp=var; vp; vp=vp->next_variable ) {
+ if ((vp->type & 0xF0) == 0x80) /* Exception */
+ continue;
if ( ! vp->val.integer )
continue;
if ( var->name[ var->name_length-1 ] != cur_if->ifindex ) {
@@ -661,6 +667,8 @@
cur_if->ift_dr = 0;
cur_if->ifIndex = var->name[ ifcol_len-1 ];
for (vp=var; vp; vp=vp->next_variable) {
+ if ((var->type & 0xF0) == 0x80) /* Exception */
+ continue;
if ( ! vp->val.integer )
continue;
switch (vp->name[ifcol_len-2]) {
@@ -753,11 +761,15 @@
while ( 1 ) {
if (netsnmp_query_getnext( var, ss ) != SNMP_ERR_NOERROR)
break;
+ if ((var->type & 0xF0) == 0x80) /* Exception */
+ break;
if ( snmp_oid_compare( ifcol_oid, ifcol_len-2,
var->name, ifcol_len-2) != 0 )
break; /* End of Table */
for ( vp=var; vp; vp=vp->next_variable ) {
+ if ((vp->type & 0xF0) == 0x80) /* Exception */
+ continue;
if ( ! vp->val.integer )
continue;
switch ( vp->name[ ifcol_len-2 ] ) {