inet_ecn.h (0660e03f6b18f19b6bbafe7583265a51b90daf36) inet_ecn.h (27a884dc3cb63b93c2b3b643f5b31eed5f8a4d26)
1#ifndef _INET_ECN_H_
2#define _INET_ECN_H_
3
4#include <linux/ip.h>
5#include <linux/skbuff.h>
6
7#include <net/inet_sock.h>
8#include <net/dsfield.h>

--- 100 unchanged lines hidden (view full) ---

109 u32 dscp = ipv6_get_dsfield(outer) & ~INET_ECN_MASK;
110 ipv6_change_dsfield(inner, INET_ECN_MASK, dscp);
111}
112
113static inline int INET_ECN_set_ce(struct sk_buff *skb)
114{
115 switch (skb->protocol) {
116 case __constant_htons(ETH_P_IP):
1#ifndef _INET_ECN_H_
2#define _INET_ECN_H_
3
4#include <linux/ip.h>
5#include <linux/skbuff.h>
6
7#include <net/inet_sock.h>
8#include <net/dsfield.h>

--- 100 unchanged lines hidden (view full) ---

109 u32 dscp = ipv6_get_dsfield(outer) & ~INET_ECN_MASK;
110 ipv6_change_dsfield(inner, INET_ECN_MASK, dscp);
111}
112
113static inline int INET_ECN_set_ce(struct sk_buff *skb)
114{
115 switch (skb->protocol) {
116 case __constant_htons(ETH_P_IP):
117 if (skb_network_header(skb) + sizeof(struct iphdr) <=
118 skb->tail)
117 if (skb->network_header + sizeof(struct iphdr) <= skb->tail)
119 return IP_ECN_set_ce(ip_hdr(skb));
120 break;
121
122 case __constant_htons(ETH_P_IPV6):
118 return IP_ECN_set_ce(ip_hdr(skb));
119 break;
120
121 case __constant_htons(ETH_P_IPV6):
123 if (skb_network_header(skb) + sizeof(struct ipv6hdr) <=
124 skb->tail)
122 if (skb->network_header + sizeof(struct ipv6hdr) <= skb->tail)
125 return IP6_ECN_set_ce(ipv6_hdr(skb));
126 break;
127 }
128
129 return 0;
130}
131
132#endif
123 return IP6_ECN_set_ce(ipv6_hdr(skb));
124 break;
125 }
126
127 return 0;
128}
129
130#endif