Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F167145415
D20233.id57292.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D20233.id57292.diff
View Options
Index: head/sys/netinet/netdump/netdump_client.c
===================================================================
--- head/sys/netinet/netdump/netdump_client.c
+++ head/sys/netinet/netdump/netdump_client.c
@@ -119,10 +119,16 @@
CTASSERT(sizeof(rcvd_acks) * NBBY == NETDUMP_MAX_IN_FLIGHT);
/* Configuration parameters. */
-static struct diocskerneldump_arg nd_conf;
-#define nd_server nd_conf.kda_server.in4
-#define nd_client nd_conf.kda_client.in4
-#define nd_gateway nd_conf.kda_gateway.in4
+static struct {
+ char ndc_iface[IFNAMSIZ];
+ union kd_ip ndc_server;
+ union kd_ip ndc_client;
+ union kd_ip ndc_gateway;
+ uint8_t ndc_af;
+} nd_conf;
+#define nd_server nd_conf.ndc_server.in4
+#define nd_client nd_conf.ndc_client.in4
+#define nd_gateway nd_conf.ndc_gateway.in4
/* General dynamic settings. */
static struct ether_addr nd_gw_mac;
@@ -1087,8 +1093,20 @@
return (ENODEV);
nd_ifp = ifp;
+
netdump_reinit(ifp);
- memcpy(&nd_conf, conf, sizeof(nd_conf));
+#define COPY_SIZED(elm) do { \
+ _Static_assert(sizeof(nd_conf.ndc_ ## elm) == \
+ sizeof(conf->kda_ ## elm), "elm " __XSTRING(elm) " mismatch"); \
+ memcpy(&nd_conf.ndc_ ## elm, &conf->kda_ ## elm, \
+ sizeof(nd_conf.ndc_ ## elm)); \
+} while (0)
+ COPY_SIZED(iface);
+ COPY_SIZED(server);
+ COPY_SIZED(client);
+ COPY_SIZED(gateway);
+ COPY_SIZED(af);
+#undef COPY_SIZED
nd_enabled = 1;
return (0);
}
@@ -1193,7 +1211,7 @@
error = ENXIO;
break;
}
- if (nd_conf.kda_af != AF_INET) {
+ if (nd_conf.ndc_af != AF_INET) {
error = EOPNOTSUPP;
break;
}
@@ -1225,7 +1243,7 @@
memcpy(&conf->kda_server, &nd_server, sizeof(nd_server));
memcpy(&conf->kda_client, &nd_client, sizeof(nd_client));
memcpy(&conf->kda_gateway, &nd_gateway, sizeof(nd_gateway));
- conf->kda_af = nd_conf.kda_af;
+ conf->kda_af = nd_conf.ndc_af;
conf = NULL;
break;
@@ -1397,7 +1415,7 @@
bzero(&kda, sizeof(kda));
kda.kda_index = KDA_REMOVE_DEV;
- (void)dumper_remove(nd_conf.kda_iface, &kda);
+ (void)dumper_remove(nd_conf.ndc_iface, &kda);
netdump_mbuf_drain();
nd_enabled = 0;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Aug 20, 11:39 AM (22 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36863760
Default Alt Text
D20233.id57292.diff (2 KB)
Attached To
Mode
D20233: netdump: Don't store sensitive key data we don't need
Attached
Detach File
Event Timeline
Log In to Comment