Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F141139354
D9625.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
D9625.diff
View Options
Index: head/sys/netpfil/pf/pf_osfp.c
===================================================================
--- head/sys/netpfil/pf/pf_osfp.c
+++ head/sys/netpfil/pf/pf_osfp.c
@@ -19,6 +19,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_inet6.h"
+
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/lock.h>
@@ -34,7 +36,9 @@
#include <net/vnet.h>
#include <net/pfvar.h>
+#ifdef INET6
#include <netinet/ip6.h>
+#endif
static MALLOC_DEFINE(M_PFOSFP, "pf_osfp", "pf(4) operating system fingerprints");
#define DPFPRINTF(format, x...) \
@@ -94,7 +98,11 @@
struct pf_os_fingerprint fp, *fpresult;
int cnt, optlen = 0;
const u_int8_t *optp;
- char srcname[128];
+#ifdef INET6
+ char srcname[INET6_ADDRSTRLEN];
+#else
+ char srcname[INET_ADDRSTRLEN];
+#endif
if ((tcp->th_flags & (TH_SYN|TH_ACK)) != TH_SYN)
return (NULL);
@@ -110,7 +118,7 @@
fp.fp_ttl = ip->ip_ttl;
if (ip->ip_off & htons(IP_DF))
fp.fp_flags |= PF_OSFP_DF;
- strlcpy(srcname, inet_ntoa(ip->ip_src), sizeof(srcname));
+ inet_ntoa_r(ip->ip_src, srcname);
}
#ifdef INET6
else if (ip6) {
@@ -119,8 +127,7 @@
fp.fp_ttl = ip6->ip6_hlim;
fp.fp_flags |= PF_OSFP_DF;
fp.fp_flags |= PF_OSFP_INET6;
- strlcpy(srcname, ip6_sprintf((struct in6_addr *)&ip6->ip6_src),
- sizeof(srcname));
+ ip6_sprintf(srcname, (const struct in6_addr *)&ip6->ip6_src);
}
#endif
else
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 2, 9:41 AM (58 m, 23 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27454906
Default Alt Text
D9625.diff (1 KB)
Attached To
Mode
D9625: Remove inet_ntoa(); use inet_ntoa_r() instead
Attached
Detach File
Event Timeline
Log In to Comment