Page MenuHomeFreeBSD

D35144.diff
No OneTemporary

D35144.diff

diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -341,11 +341,15 @@
free(formatstr);
}
+/* Skip sorting for interfaces with more IP addresses than this limit */
+#define IFADDR_SORT_LIMIT 32
+
static struct ifaddrs *
sortifaddrs(struct ifaddrs *list,
int (*compare)(struct ifaddrs *, struct ifaddrs *, struct ifa_queue *),
struct ifa_queue *q)
{
+ int count;
struct ifaddrs *right, *temp, *last, *result, *next, *tail;
right = list;
@@ -358,7 +362,10 @@
if (!list || !list->ifa_next)
return (list);
+ count = 0;
while (temp && temp->ifa_next) {
+ if (count++ >= IFADDR_SORT_LIMIT)
+ return (list);
last = right;
right = right->ifa_next;
temp = temp->ifa_next->ifa_next;

File Metadata

Mime Type
text/plain
Expires
Wed, Aug 26, 1:12 AM (19 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37260258
Default Alt Text
D35144.diff (798 B)

Event Timeline