Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145161264
D42690.1777497571.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D42690.1777497571.diff
View Options
diff --git a/sys/netgraph/ng_message.h b/sys/netgraph/ng_message.h
--- a/sys/netgraph/ng_message.h
+++ b/sys/netgraph/ng_message.h
@@ -42,7 +42,10 @@
#ifndef _NETGRAPH_NG_MESSAGE_H_
#define _NETGRAPH_NG_MESSAGE_H_
-/* ASCII string size limits */
+/*
+ * ASCII string size limits
+ * Check with struct sockaddr_ng if changing.
+ */
#define NG_TYPESIZ 32 /* max type name len (including null) */
#define NG_HOOKSIZ 32 /* max hook name len (including null) */
#define NG_NODESIZ 32 /* max node name len (including null) */
diff --git a/sys/netgraph/ng_socket.h b/sys/netgraph/ng_socket.h
--- a/sys/netgraph/ng_socket.h
+++ b/sys/netgraph/ng_socket.h
@@ -60,7 +60,7 @@
struct sockaddr_ng {
unsigned char sg_len; /* total length */
sa_family_t sg_family; /* address family */
- char sg_data[14]; /* actually longer; address value */
+ char sg_data[32]; /* see NG_NODESIZ in ng_message.h */
};
#endif /* _NETGRAPH_NG_SOCKET_H_ */
diff --git a/tests/sys/netgraph/socket.c b/tests/sys/netgraph/socket.c
--- a/tests/sys/netgraph/socket.c
+++ b/tests/sys/netgraph/socket.c
@@ -53,12 +53,7 @@
/* Named node. */
ATF_REQUIRE(NgMkSockNode(name, &cs, NULL) == 0);
ATF_REQUIRE(getsockname(cs, (struct sockaddr *)&sg, &len) == 0);
-#if 0
- /* sockaddr_ng truncates name now. */
ATF_REQUIRE(strcmp(sg.sg_data, NAME) == 0);
-#else
- ATF_REQUIRE(strncmp(sg.sg_data, NAME, sizeof(sg.sg_data)) == 0);
-#endif
}
ATF_TP_ADD_TCS(tp)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 29, 9:19 PM (6 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28468665
Default Alt Text
D42690.1777497571.diff (1 KB)
Attached To
Mode
D42690: netgraph: increase size of sockaddr_ng to match maximum node name
Attached
Detach File
Event Timeline
Log In to Comment