diff options
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/dst.h | 6 | ||||
| -rw-r--r-- | include/net/flow_keys.h | 1 | ||||
| -rw-r--r-- | include/net/inet_frag.h | 9 | ||||
| -rw-r--r-- | include/net/ip_fib.h | 12 | ||||
| -rw-r--r-- | include/net/ip_vs.h | 12 | ||||
| -rw-r--r-- | include/net/ipip.h | 16 | ||||
| -rw-r--r-- | include/net/tcp.h | 4 |
7 files changed, 41 insertions, 19 deletions
diff --git a/include/net/dst.h b/include/net/dst.h index 853cda11e518..1f8fd109e225 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
| @@ -413,13 +413,15 @@ static inline int dst_neigh_output(struct dst_entry *dst, struct neighbour *n, | |||
| 413 | 413 | ||
| 414 | static inline struct neighbour *dst_neigh_lookup(const struct dst_entry *dst, const void *daddr) | 414 | static inline struct neighbour *dst_neigh_lookup(const struct dst_entry *dst, const void *daddr) |
| 415 | { | 415 | { |
| 416 | return dst->ops->neigh_lookup(dst, NULL, daddr); | 416 | struct neighbour *n = dst->ops->neigh_lookup(dst, NULL, daddr); |
| 417 | return IS_ERR(n) ? NULL : n; | ||
| 417 | } | 418 | } |
| 418 | 419 | ||
| 419 | static inline struct neighbour *dst_neigh_lookup_skb(const struct dst_entry *dst, | 420 | static inline struct neighbour *dst_neigh_lookup_skb(const struct dst_entry *dst, |
| 420 | struct sk_buff *skb) | 421 | struct sk_buff *skb) |
| 421 | { | 422 | { |
| 422 | return dst->ops->neigh_lookup(dst, skb, NULL); | 423 | struct neighbour *n = dst->ops->neigh_lookup(dst, skb, NULL); |
| 424 | return IS_ERR(n) ? NULL : n; | ||
| 423 | } | 425 | } |
| 424 | 426 | ||
| 425 | static inline void dst_link_failure(struct sk_buff *skb) | 427 | static inline void dst_link_failure(struct sk_buff *skb) |
diff --git a/include/net/flow_keys.h b/include/net/flow_keys.h index 80461c1ae9ef..bb8271d487b7 100644 --- a/include/net/flow_keys.h +++ b/include/net/flow_keys.h | |||
| @@ -9,6 +9,7 @@ struct flow_keys { | |||
| 9 | __be32 ports; | 9 | __be32 ports; |
| 10 | __be16 port16[2]; | 10 | __be16 port16[2]; |
| 11 | }; | 11 | }; |
| 12 | u16 thoff; | ||
| 12 | u8 ip_proto; | 13 | u8 ip_proto; |
| 13 | }; | 14 | }; |
| 14 | 15 | ||
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h index 76c3fe5ecc2e..0a1dcc2fa2f5 100644 --- a/include/net/inet_frag.h +++ b/include/net/inet_frag.h | |||
| @@ -43,6 +43,13 @@ struct inet_frag_queue { | |||
| 43 | 43 | ||
| 44 | #define INETFRAGS_HASHSZ 64 | 44 | #define INETFRAGS_HASHSZ 64 |
| 45 | 45 | ||
| 46 | /* averaged: | ||
| 47 | * max_depth = default ipfrag_high_thresh / INETFRAGS_HASHSZ / | ||
| 48 | * rounded up (SKB_TRUELEN(0) + sizeof(struct ipq or | ||
| 49 | * struct frag_queue)) | ||
| 50 | */ | ||
| 51 | #define INETFRAGS_MAXDEPTH 128 | ||
| 52 | |||
| 46 | struct inet_frags { | 53 | struct inet_frags { |
| 47 | struct hlist_head hash[INETFRAGS_HASHSZ]; | 54 | struct hlist_head hash[INETFRAGS_HASHSZ]; |
| 48 | /* This rwlock is a global lock (seperate per IPv4, IPv6 and | 55 | /* This rwlock is a global lock (seperate per IPv4, IPv6 and |
| @@ -76,6 +83,8 @@ int inet_frag_evictor(struct netns_frags *nf, struct inet_frags *f, bool force); | |||
| 76 | struct inet_frag_queue *inet_frag_find(struct netns_frags *nf, | 83 | struct inet_frag_queue *inet_frag_find(struct netns_frags *nf, |
| 77 | struct inet_frags *f, void *key, unsigned int hash) | 84 | struct inet_frags *f, void *key, unsigned int hash) |
| 78 | __releases(&f->lock); | 85 | __releases(&f->lock); |
| 86 | void inet_frag_maybe_warn_overflow(struct inet_frag_queue *q, | ||
| 87 | const char *prefix); | ||
| 79 | 88 | ||
| 80 | static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f) | 89 | static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f) |
| 81 | { | 90 | { |
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 9497be1ad4c0..e49db91593a9 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
| @@ -152,18 +152,16 @@ struct fib_result_nl { | |||
| 152 | }; | 152 | }; |
| 153 | 153 | ||
| 154 | #ifdef CONFIG_IP_ROUTE_MULTIPATH | 154 | #ifdef CONFIG_IP_ROUTE_MULTIPATH |
| 155 | |||
| 156 | #define FIB_RES_NH(res) ((res).fi->fib_nh[(res).nh_sel]) | 155 | #define FIB_RES_NH(res) ((res).fi->fib_nh[(res).nh_sel]) |
| 157 | |||
| 158 | #define FIB_TABLE_HASHSZ 2 | ||
| 159 | |||
| 160 | #else /* CONFIG_IP_ROUTE_MULTIPATH */ | 156 | #else /* CONFIG_IP_ROUTE_MULTIPATH */ |
| 161 | |||
| 162 | #define FIB_RES_NH(res) ((res).fi->fib_nh[0]) | 157 | #define FIB_RES_NH(res) ((res).fi->fib_nh[0]) |
| 158 | #endif /* CONFIG_IP_ROUTE_MULTIPATH */ | ||
| 163 | 159 | ||
| 160 | #ifdef CONFIG_IP_MULTIPLE_TABLES | ||
| 164 | #define FIB_TABLE_HASHSZ 256 | 161 | #define FIB_TABLE_HASHSZ 256 |
| 165 | 162 | #else | |
| 166 | #endif /* CONFIG_IP_ROUTE_MULTIPATH */ | 163 | #define FIB_TABLE_HASHSZ 2 |
| 164 | #endif | ||
| 167 | 165 | ||
| 168 | extern __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh); | 166 | extern __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh); |
| 169 | 167 | ||
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 68c69d54d392..fce8e6b66d55 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
| @@ -976,6 +976,7 @@ struct netns_ipvs { | |||
| 976 | int sysctl_sync_retries; | 976 | int sysctl_sync_retries; |
| 977 | int sysctl_nat_icmp_send; | 977 | int sysctl_nat_icmp_send; |
| 978 | int sysctl_pmtu_disc; | 978 | int sysctl_pmtu_disc; |
| 979 | int sysctl_backup_only; | ||
| 979 | 980 | ||
| 980 | /* ip_vs_lblc */ | 981 | /* ip_vs_lblc */ |
| 981 | int sysctl_lblc_expiration; | 982 | int sysctl_lblc_expiration; |
| @@ -1067,6 +1068,12 @@ static inline int sysctl_pmtu_disc(struct netns_ipvs *ipvs) | |||
| 1067 | return ipvs->sysctl_pmtu_disc; | 1068 | return ipvs->sysctl_pmtu_disc; |
| 1068 | } | 1069 | } |
| 1069 | 1070 | ||
| 1071 | static inline int sysctl_backup_only(struct netns_ipvs *ipvs) | ||
| 1072 | { | ||
| 1073 | return ipvs->sync_state & IP_VS_STATE_BACKUP && | ||
| 1074 | ipvs->sysctl_backup_only; | ||
| 1075 | } | ||
| 1076 | |||
| 1070 | #else | 1077 | #else |
| 1071 | 1078 | ||
| 1072 | static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs) | 1079 | static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs) |
| @@ -1114,6 +1121,11 @@ static inline int sysctl_pmtu_disc(struct netns_ipvs *ipvs) | |||
| 1114 | return 1; | 1121 | return 1; |
| 1115 | } | 1122 | } |
| 1116 | 1123 | ||
| 1124 | static inline int sysctl_backup_only(struct netns_ipvs *ipvs) | ||
| 1125 | { | ||
| 1126 | return 0; | ||
| 1127 | } | ||
| 1128 | |||
| 1117 | #endif | 1129 | #endif |
| 1118 | 1130 | ||
| 1119 | /* | 1131 | /* |
diff --git a/include/net/ipip.h b/include/net/ipip.h index fd19625ff99d..982141c15200 100644 --- a/include/net/ipip.h +++ b/include/net/ipip.h | |||
| @@ -77,15 +77,11 @@ static inline void tunnel_ip_select_ident(struct sk_buff *skb, | |||
| 77 | { | 77 | { |
| 78 | struct iphdr *iph = ip_hdr(skb); | 78 | struct iphdr *iph = ip_hdr(skb); |
| 79 | 79 | ||
| 80 | if (iph->frag_off & htons(IP_DF)) | 80 | /* Use inner packet iph-id if possible. */ |
| 81 | iph->id = 0; | 81 | if (skb->protocol == htons(ETH_P_IP) && old_iph->id) |
| 82 | else { | 82 | iph->id = old_iph->id; |
| 83 | /* Use inner packet iph-id if possible. */ | 83 | else |
| 84 | if (skb->protocol == htons(ETH_P_IP) && old_iph->id) | 84 | __ip_select_ident(iph, dst, |
| 85 | iph->id = old_iph->id; | 85 | (skb_shinfo(skb)->gso_segs ?: 1) - 1); |
| 86 | else | ||
| 87 | __ip_select_ident(iph, dst, | ||
| 88 | (skb_shinfo(skb)->gso_segs ?: 1) - 1); | ||
| 89 | } | ||
| 90 | } | 86 | } |
| 91 | #endif | 87 | #endif |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 23f2e98d4b65..cf0694d4ad60 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
| @@ -1045,6 +1045,10 @@ static inline bool tcp_prequeue(struct sock *sk, struct sk_buff *skb) | |||
| 1045 | if (sysctl_tcp_low_latency || !tp->ucopy.task) | 1045 | if (sysctl_tcp_low_latency || !tp->ucopy.task) |
| 1046 | return false; | 1046 | return false; |
| 1047 | 1047 | ||
| 1048 | if (skb->len <= tcp_hdrlen(skb) && | ||
| 1049 | skb_queue_len(&tp->ucopy.prequeue) == 0) | ||
| 1050 | return false; | ||
| 1051 | |||
| 1048 | __skb_queue_tail(&tp->ucopy.prequeue, skb); | 1052 | __skb_queue_tail(&tp->ucopy.prequeue, skb); |
| 1049 | tp->ucopy.memory += skb->truesize; | 1053 | tp->ucopy.memory += skb->truesize; |
| 1050 | if (tp->ucopy.memory > sk->sk_rcvbuf) { | 1054 | if (tp->ucopy.memory > sk->sk_rcvbuf) { |
