View | Details | Raw Unified | Return to bug 265664
Collapse All | Expand All

(-)b/sys/netinet/tcp_lro.h (-5 / +10 lines)
Lines 34-39 Link Here
34
#define _TCP_LRO_H_
34
#define _TCP_LRO_H_
35
35
36
#include <sys/time.h>
36
#include <sys/time.h>
37
#include <sys/param.h>
38
37
#include <netinet/in.h>
39
#include <netinet/in.h>
38
40
39
#ifndef TCP_LRO_ENTRIES
41
#ifndef TCP_LRO_ENTRIES
Lines 65-72 Link Here
65
67
66
struct inpcb;
68
struct inpcb;
67
69
70
/* Precompute the LRO_RAW_ADDRESS_MAX value: */
71
#define	LRO_RAW_ADDRESS_MAX \
72
	howmany(12 + 2 * sizeof(struct in6_addr), sizeof(u_long))
73
68
union lro_address {
74
union lro_address {
69
	u_long raw[1];
75
	u_long raw[LRO_RAW_ADDRESS_MAX];
70
	struct {
76
	struct {
71
		uint8_t lro_type;	/* internal */
77
		uint8_t lro_type;	/* internal */
72
#define	LRO_TYPE_NONE     0
78
#define	LRO_TYPE_NONE     0
Lines 89-98 union lro_address { Link Here
89
			struct in6_addr v6;
95
			struct in6_addr v6;
90
		} d_addr;	/* destination IPv4/IPv6 address */
96
		} d_addr;	/* destination IPv4/IPv6 address */
91
	};
97
	};
92
} __aligned(sizeof(u_long));
98
};
93
99
94
#define	LRO_RAW_ADDRESS_MAX \
100
_Static_assert(sizeof(union lro_address) == sizeof(u_long) * LRO_RAW_ADDRESS_MAX,
95
    (sizeof(union lro_address) / sizeof(u_long))
101
    "The raw field in the lro_address union does not cover the whole structure.");
96
102
97
/* Optimize address comparison by comparing one unsigned long at a time: */
103
/* Optimize address comparison by comparing one unsigned long at a time: */
98
104
99
- 

Return to bug 265664