diff options
-rw-r--r-- | include/net/inet_common.h | 2 | ||||
-rw-r--r-- | net/core/dev.c | 15 | ||||
-rw-r--r-- | net/ipv6/ip6_offload.c | 6 |
3 files changed, 18 insertions, 5 deletions
diff --git a/include/net/inet_common.h b/include/net/inet_common.h index 3ca969cbd161..56e7592811ea 100644 --- a/include/net/inet_common.h +++ b/include/net/inet_common.h | |||
@@ -2,6 +2,8 @@ | |||
2 | #ifndef _INET_COMMON_H | 2 | #ifndef _INET_COMMON_H |
3 | #define _INET_COMMON_H | 3 | #define _INET_COMMON_H |
4 | 4 | ||
5 | #include <linux/indirect_call_wrapper.h> | ||
6 | |||
5 | extern const struct proto_ops inet_stream_ops; | 7 | extern const struct proto_ops inet_stream_ops; |
6 | extern const struct proto_ops inet_dgram_ops; | 8 | extern const struct proto_ops inet_dgram_ops; |
7 | 9 | ||
diff --git a/net/core/dev.c b/net/core/dev.c index ed9aa4a91f1f..1b5a4410be0e 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -145,6 +145,7 @@ | |||
145 | #include <linux/sctp.h> | 145 | #include <linux/sctp.h> |
146 | #include <net/udp_tunnel.h> | 146 | #include <net/udp_tunnel.h> |
147 | #include <linux/net_namespace.h> | 147 | #include <linux/net_namespace.h> |
148 | #include <linux/indirect_call_wrapper.h> | ||
148 | 149 | ||
149 | #include "net-sysfs.h" | 150 | #include "net-sysfs.h" |
150 | 151 | ||
@@ -5338,6 +5339,8 @@ static void flush_all_backlogs(void) | |||
5338 | put_online_cpus(); | 5339 | put_online_cpus(); |
5339 | } | 5340 | } |
5340 | 5341 | ||
5342 | INDIRECT_CALLABLE_DECLARE(int inet_gro_complete(struct sk_buff *, int)); | ||
5343 | INDIRECT_CALLABLE_DECLARE(int ipv6_gro_complete(struct sk_buff *, int)); | ||
5341 | static int napi_gro_complete(struct sk_buff *skb) | 5344 | static int napi_gro_complete(struct sk_buff *skb) |
5342 | { | 5345 | { |
5343 | struct packet_offload *ptype; | 5346 | struct packet_offload *ptype; |
@@ -5357,7 +5360,9 @@ static int napi_gro_complete(struct sk_buff *skb) | |||
5357 | if (ptype->type != type || !ptype->callbacks.gro_complete) | 5360 | if (ptype->type != type || !ptype->callbacks.gro_complete) |
5358 | continue; | 5361 | continue; |
5359 | 5362 | ||
5360 | err = ptype->callbacks.gro_complete(skb, 0); | 5363 | err = INDIRECT_CALL_INET(ptype->callbacks.gro_complete, |
5364 | ipv6_gro_complete, inet_gro_complete, | ||
5365 | skb, 0); | ||
5361 | break; | 5366 | break; |
5362 | } | 5367 | } |
5363 | rcu_read_unlock(); | 5368 | rcu_read_unlock(); |
@@ -5504,6 +5509,10 @@ static void gro_flush_oldest(struct list_head *head) | |||
5504 | napi_gro_complete(oldest); | 5509 | napi_gro_complete(oldest); |
5505 | } | 5510 | } |
5506 | 5511 | ||
5512 | INDIRECT_CALLABLE_DECLARE(struct sk_buff *inet_gro_receive(struct list_head *, | ||
5513 | struct sk_buff *)); | ||
5514 | INDIRECT_CALLABLE_DECLARE(struct sk_buff *ipv6_gro_receive(struct list_head *, | ||
5515 | struct sk_buff *)); | ||
5507 | static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb) | 5516 | static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb) |
5508 | { | 5517 | { |
5509 | u32 hash = skb_get_hash_raw(skb) & (GRO_HASH_BUCKETS - 1); | 5518 | u32 hash = skb_get_hash_raw(skb) & (GRO_HASH_BUCKETS - 1); |
@@ -5553,7 +5562,9 @@ static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff | |||
5553 | NAPI_GRO_CB(skb)->csum_valid = 0; | 5562 | NAPI_GRO_CB(skb)->csum_valid = 0; |
5554 | } | 5563 | } |
5555 | 5564 | ||
5556 | pp = ptype->callbacks.gro_receive(gro_head, skb); | 5565 | pp = INDIRECT_CALL_INET(ptype->callbacks.gro_receive, |
5566 | ipv6_gro_receive, inet_gro_receive, | ||
5567 | gro_head, skb); | ||
5557 | break; | 5568 | break; |
5558 | } | 5569 | } |
5559 | rcu_read_unlock(); | 5570 | rcu_read_unlock(); |
diff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c index 70f525c33cb6..ff8b484d2258 100644 --- a/net/ipv6/ip6_offload.c +++ b/net/ipv6/ip6_offload.c | |||
@@ -164,8 +164,8 @@ static int ipv6_exthdrs_len(struct ipv6hdr *iph, | |||
164 | return len; | 164 | return len; |
165 | } | 165 | } |
166 | 166 | ||
167 | static struct sk_buff *ipv6_gro_receive(struct list_head *head, | 167 | INDIRECT_CALLABLE_SCOPE struct sk_buff *ipv6_gro_receive(struct list_head *head, |
168 | struct sk_buff *skb) | 168 | struct sk_buff *skb) |
169 | { | 169 | { |
170 | const struct net_offload *ops; | 170 | const struct net_offload *ops; |
171 | struct sk_buff *pp = NULL; | 171 | struct sk_buff *pp = NULL; |
@@ -301,7 +301,7 @@ static struct sk_buff *ip4ip6_gro_receive(struct list_head *head, | |||
301 | return inet_gro_receive(head, skb); | 301 | return inet_gro_receive(head, skb); |
302 | } | 302 | } |
303 | 303 | ||
304 | static int ipv6_gro_complete(struct sk_buff *skb, int nhoff) | 304 | INDIRECT_CALLABLE_SCOPE int ipv6_gro_complete(struct sk_buff *skb, int nhoff) |
305 | { | 305 | { |
306 | const struct net_offload *ops; | 306 | const struct net_offload *ops; |
307 | struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + nhoff); | 307 | struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + nhoff); |