ip_vs.h (63dca2c0b0e7a92cb39d1b1ecefa32ffda201975) | ip_vs.h (2f74713d1436b7d2d0506ba1bc5f10915a73bbec) |
---|---|
1/* 2 * IP Virtual Server 3 * data structure and functionality definitions 4 */ 5 6#ifndef _NET_IP_VS_H 7#define _NET_IP_VS_H 8 --- 95 unchanged lines hidden (view full) --- 104} 105 106/* Connections' size value needed by ip_vs_ctl.c */ 107extern int ip_vs_conn_tab_size; 108 109struct ip_vs_iphdr { 110 __u32 len; /* IPv4 simply where L4 starts 111 IPv6 where L4 Transport Header starts */ | 1/* 2 * IP Virtual Server 3 * data structure and functionality definitions 4 */ 5 6#ifndef _NET_IP_VS_H 7#define _NET_IP_VS_H 8 --- 95 unchanged lines hidden (view full) --- 104} 105 106/* Connections' size value needed by ip_vs_ctl.c */ 107extern int ip_vs_conn_tab_size; 108 109struct ip_vs_iphdr { 110 __u32 len; /* IPv4 simply where L4 starts 111 IPv6 where L4 Transport Header starts */ |
112 __u32 thoff_reasm; /* Transport Header Offset in nfct_reasm skb */ |
|
112 __u16 fragoffs; /* IPv6 fragment offset, 0 if first frag (or not frag)*/ 113 __s16 protocol; 114 __s32 flags; 115 union nf_inet_addr saddr; 116 union nf_inet_addr daddr; 117}; 118 | 113 __u16 fragoffs; /* IPv6 fragment offset, 0 if first frag (or not frag)*/ 114 __s16 protocol; 115 __s32 flags; 116 union nf_inet_addr saddr; 117 union nf_inet_addr daddr; 118}; 119 |
120/* Dependency to module: nf_defrag_ipv6 */ 121#if defined(CONFIG_NF_DEFRAG_IPV6) || defined(CONFIG_NF_DEFRAG_IPV6_MODULE) 122static inline struct sk_buff *skb_nfct_reasm(const struct sk_buff *skb) 123{ 124 return skb->nfct_reasm; 125} 126static inline void *frag_safe_skb_hp(const struct sk_buff *skb, int offset, 127 int len, void *buffer, 128 const struct ip_vs_iphdr *ipvsh) 129{ 130 if (unlikely(ipvsh->fragoffs && skb_nfct_reasm(skb))) 131 return skb_header_pointer(skb_nfct_reasm(skb), 132 ipvsh->thoff_reasm, len, buffer); 133 134 return skb_header_pointer(skb, offset, len, buffer); 135} 136#else 137static inline struct sk_buff *skb_nfct_reasm(const struct sk_buff *skb) 138{ 139 return NULL; 140} 141static inline void *frag_safe_skb_hp(const struct sk_buff *skb, int offset, 142 int len, void *buffer, 143 const struct ip_vs_iphdr *ipvsh) 144{ 145 return skb_header_pointer(skb, offset, len, buffer); 146} 147#endif 148 |
|
119static inline void 120ip_vs_fill_ip4hdr(const void *nh, struct ip_vs_iphdr *iphdr) 121{ 122 const struct iphdr *iph = nh; 123 124 iphdr->len = iph->ihl * 4; 125 iphdr->fragoffs = 0; 126 iphdr->protocol = iph->protocol; --- 9 unchanged lines hidden (view full) --- 136ip_vs_fill_iph_skb(int af, const struct sk_buff *skb, struct ip_vs_iphdr *iphdr) 137{ 138#ifdef CONFIG_IP_VS_IPV6 139 if (af == AF_INET6) { 140 const struct ipv6hdr *iph = 141 (struct ipv6hdr *)skb_network_header(skb); 142 iphdr->saddr.in6 = iph->saddr; 143 iphdr->daddr.in6 = iph->daddr; | 149static inline void 150ip_vs_fill_ip4hdr(const void *nh, struct ip_vs_iphdr *iphdr) 151{ 152 const struct iphdr *iph = nh; 153 154 iphdr->len = iph->ihl * 4; 155 iphdr->fragoffs = 0; 156 iphdr->protocol = iph->protocol; --- 9 unchanged lines hidden (view full) --- 166ip_vs_fill_iph_skb(int af, const struct sk_buff *skb, struct ip_vs_iphdr *iphdr) 167{ 168#ifdef CONFIG_IP_VS_IPV6 169 if (af == AF_INET6) { 170 const struct ipv6hdr *iph = 171 (struct ipv6hdr *)skb_network_header(skb); 172 iphdr->saddr.in6 = iph->saddr; 173 iphdr->daddr.in6 = iph->daddr; |
144 /* ipv6_find_hdr() updates len, flags */ | 174 /* ipv6_find_hdr() updates len, flags, thoff_reasm */ 175 iphdr->thoff_reasm = 0; |
145 iphdr->len = 0; 146 iphdr->flags = 0; 147 iphdr->protocol = ipv6_find_hdr(skb, &iphdr->len, -1, 148 &iphdr->fragoffs, 149 &iphdr->flags); | 176 iphdr->len = 0; 177 iphdr->flags = 0; 178 iphdr->protocol = ipv6_find_hdr(skb, &iphdr->len, -1, 179 &iphdr->fragoffs, 180 &iphdr->flags); |
181 /* get proto from re-assembled packet and it's offset */ 182 if (skb_nfct_reasm(skb)) 183 iphdr->protocol = ipv6_find_hdr(skb_nfct_reasm(skb), 184 &iphdr->thoff_reasm, 185 -1, NULL, NULL); 186 |
|
150 } else 151#endif 152 { 153 const struct iphdr *iph = 154 (struct iphdr *)skb_network_header(skb); 155 iphdr->len = iph->ihl * 4; 156 iphdr->fragoffs = 0; 157 iphdr->protocol = iph->protocol; --- 1400 unchanged lines hidden --- | 187 } else 188#endif 189 { 190 const struct iphdr *iph = 191 (struct iphdr *)skb_network_header(skb); 192 iphdr->len = iph->ihl * 4; 193 iphdr->fragoffs = 0; 194 iphdr->protocol = iph->protocol; --- 1400 unchanged lines hidden --- |