From: Guy Harris Date: Tue, 28 Dec 2010 21:15:26 +0000 (-0800) Subject: Interface IDs are 0-origin. X-Git-Tag: libpcap-1.2.1~85^2~16 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/028204e0f99f0bad5dfd01add364ebd4f4befabb Interface IDs are 0-origin. That means that if an interface ID is greater than *or equal to* the number of Interface Description Blocks we've seen, we haven't seen an IDB for that interface. --- diff --git a/sf-pcap-ng.c b/sf-pcap-ng.c index 90499915..1554320a 100644 --- a/sf-pcap-ng.c +++ b/sf-pcap-ng.c @@ -1053,7 +1053,7 @@ found: /* * Is the interface ID an interface we know? */ - if (interface_id > p->sf.ifcount) { + if (interface_id >= p->sf.ifcount) { /* * Yes. Fail. */