Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151225476
D54723.id169751.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D54723.id169751.diff
View Options
diff --git a/sys/netinet/icmp6.h b/sys/netinet/icmp6.h
--- a/sys/netinet/icmp6.h
+++ b/sys/netinet/icmp6.h
@@ -717,8 +717,7 @@
#define icmp6_ifstat_inc(ifp, tag) \
do { \
if (ifp) \
- counter_u64_add(((struct in6_ifextra *) \
- ((ifp)->if_inet6))->icmp6_ifstat[ \
+ counter_u64_add((ifp)->if_inet6->icmp6_ifstat[ \
offsetof(struct icmp6_ifstat, tag) / sizeof(uint64_t)], 1);\
} while (/*CONSTCOND*/ 0)
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -2610,14 +2610,8 @@
ext = (struct in6_ifextra *)malloc(sizeof(*ext), M_IFADDR, M_WAITOK);
bzero(ext, sizeof(*ext));
- ext->in6_ifstat = malloc(sizeof(counter_u64_t) *
- sizeof(struct in6_ifstat) / sizeof(uint64_t), M_IFADDR, M_WAITOK);
COUNTER_ARRAY_ALLOC(ext->in6_ifstat,
sizeof(struct in6_ifstat) / sizeof(uint64_t), M_WAITOK);
-
- ext->icmp6_ifstat = malloc(sizeof(counter_u64_t) *
- sizeof(struct icmp6_ifstat) / sizeof(uint64_t), M_IFADDR,
- M_WAITOK);
COUNTER_ARRAY_ALLOC(ext->icmp6_ifstat,
sizeof(struct icmp6_ifstat) / sizeof(uint64_t), M_WAITOK);
diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c
--- a/sys/netinet6/in6_ifattach.c
+++ b/sys/netinet6/in6_ifattach.c
@@ -922,10 +922,8 @@
lltable_free(ext->lltable);
COUNTER_ARRAY_FREE(ext->in6_ifstat,
sizeof(struct in6_ifstat) / sizeof(uint64_t));
- free(ext->in6_ifstat, M_IFADDR);
COUNTER_ARRAY_FREE(ext->icmp6_ifstat,
sizeof(struct icmp6_ifstat) / sizeof(uint64_t));
- free(ext->icmp6_ifstat, M_IFADDR);
free(ext, M_IFADDR);
}
EVENTHANDLER_DEFINE(ifnet_departure_event, in6_ifdeparture, NULL,
diff --git a/sys/netinet6/in6_var.h b/sys/netinet6/in6_var.h
--- a/sys/netinet6/in6_var.h
+++ b/sys/netinet6/in6_var.h
@@ -93,25 +93,6 @@
u_int32_t ia6t_pltime; /* prefix lifetime */
};
-struct nd_ifinfo;
-struct scope6_id;
-struct lltable;
-struct mld_ifsoftc;
-struct in6_multi;
-
-struct in6_ifextra {
- counter_u64_t *in6_ifstat;
- counter_u64_t *icmp6_ifstat;
- struct nd_ifinfo *nd_ifinfo;
- struct scope6_id *scope6_id;
- struct lltable *lltable;
- struct mld_ifsoftc *mld_ifinfo;
- u_int dad_failures; /* DAD failures when using RFC 7217 stable addresses */
-};
-
-#define LLTABLE6(ifp) ((ifp)->if_inet6->lltable)
-#define DAD_FAILURES(ifp) ((ifp)->if_inet6->dad_failures)
-
#ifdef _KERNEL
SLIST_HEAD(in6_multi_head, in6_multi);
@@ -507,6 +488,23 @@
#endif
#ifdef _KERNEL
+/*
+ * Structure pointed at by ifp->if_inet6.
+ */
+struct in6_ifextra {
+ counter_u64_t in6_ifstat[sizeof(struct in6_ifstat) / sizeof(uint64_t)];
+ counter_u64_t icmp6_ifstat[sizeof(struct icmp6_ifstat) /
+ sizeof(uint64_t)];
+ struct nd_ifinfo *nd_ifinfo;
+ struct scope6_id *scope6_id;
+ struct lltable *lltable;
+ struct mld_ifsoftc *mld_ifinfo;
+ u_int dad_failures; /* DAD failures when using RFC 7217 stable addresses */
+};
+
+#define LLTABLE6(ifp) ((ifp)->if_inet6->lltable)
+#define DAD_FAILURES(ifp) ((ifp)->if_inet6->dad_failures)
+
VNET_DECLARE(struct in6_ifaddrhead, in6_ifaddrhead);
VNET_DECLARE(struct in6_ifaddrlisthead *, in6_ifaddrhashtbl);
VNET_DECLARE(u_long, in6_ifaddrhmask);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 7, 11:38 PM (15 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31055782
Default Alt Text
D54723.id169751.diff (3 KB)
Attached To
Mode
D54723: netinet6: embed the counter(9) arrays in struct in6_ifextra
Attached
Detach File
Event Timeline
Log In to Comment