Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115635079
D44819.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D44819.diff
View Options
diff --git a/sys/fs/nfsserver/nfs_nfsdkrpc.c b/sys/fs/nfsserver/nfs_nfsdkrpc.c
--- a/sys/fs/nfsserver/nfs_nfsdkrpc.c
+++ b/sys/fs/nfsserver/nfs_nfsdkrpc.c
@@ -191,6 +191,12 @@
port = ntohs(sin->sin_port);
if (port >= IPPORT_RESERVED &&
nd.nd_procnum != NFSPROC_NULL) {
+ static struct timeval privport_ratecheck = {
+ .tv_sec = 0, .tv_usec = 0
+ };
+ static const struct timeval privport_ratecheck_int = {
+ .tv_sec = 1, .tv_usec = 0
+ };
#ifdef INET6
char buf[INET6_ADDRSTRLEN];
#else
@@ -208,15 +214,19 @@
(buf))
#endif
#endif
- printf("NFS request from unprivileged port (%s:%d)\n",
+ if (ratecheck(&privport_ratecheck,
+ &privport_ratecheck_int)) {
+ printf(
+ "NFS request from unprivileged port (%s:%d)\n",
#ifdef INET6
- sin->sin_family == AF_INET6 ?
- ip6_sprintf(buf, &satosin6(sin)->sin6_addr) :
+ sin->sin_family == AF_INET6 ?
+ ip6_sprintf(buf, &satosin6(sin)->sin6_addr) :
#if defined(KLD_MODULE)
#undef ip6_sprintf
#endif
#endif
- inet_ntoa_r(sin->sin_addr, buf), port);
+ inet_ntoa_r(sin->sin_addr, buf), port);
+ }
svcerr_weakauth(rqst);
svc_freereq(rqst);
m_freem(nd.nd_mrep);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 27, 8:16 AM (5 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17815275
Default Alt Text
D44819.diff (1 KB)
Attached To
Mode
D44819: nfsserver: Rate-limit messages about requests from unprivileged ports
Attached
Detach File
Event Timeline
Log In to Comment