Project

General

Profile

Bug #6099 » patch-src__os-freebsd.h

Jorge M. Oliveira, 09/04/2016 02:49 PM

 
1
--- src/os-freebsd.h.orig
2
+++ src/os-freebsd.h
3
@@ -14,10 +14,20 @@
4
 
5
 static inline u_short ip_data_len(const struct ip *ip)
6
 {
7
+#if __FreeBSD_version >= 1100030
8
+	return ntohs(ip->ip_len) - (ip->ip_hl << 2);
9
+#elif __FreeBSD_version >= 900044
10
+	return ip->ip_len - (ip->ip_hl << 2);
11
+#else
12
 	return ip->ip_len;
13
+#endif
14
 }
15
 
16
 static inline void ip_set_len(struct ip *ip, u_short len)
17
 {
18
+#if __FreeBSD_version >= 1100030
19
+	ip->ip_len = htons(len);
20
+#else
21
 	ip->ip_len = len;
22
+#endif
23
 }
(5-5/10)