summaryrefslogtreecommitdiff
path: root/net/ipv4/af_inet.c
diff options
context:
space:
mode:
authorTonghao Zhang <xiangxia.m.yue@gmail.com>2017-08-02 19:34:15 +0300
committerDavid S. Miller <davem@davemloft.net>2017-08-03 19:27:07 +0300
commit93b1b31f87ae7c0795afc7586d28f3ed4f859d20 (patch)
treee9843f3b7d4fe90b5b47e8c53e0fbcb4af204e46 /net/ipv4/af_inet.c
parenteb48d682814c8b0e44111c45d7c554e1989fd10d (diff)
downloadlinux-93b1b31f87ae7c0795afc7586d28f3ed4f859d20.tar.xz
ipv4: Introduce ipip_offload_init helper function.
It's convenient to init ipip offload. We will check the return value, and print KERN_CRIT info on failure. Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/af_inet.c')
-rw-r--r--net/ipv4/af_inet.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index f0103ffe1cdb..683ffafb6ff9 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1765,6 +1765,11 @@ static const struct net_offload ipip_offload = {
},
};
+static int __init ipip_offload_init(void)
+{
+ return inet_add_offload(&ipip_offload, IPPROTO_IPIP);
+}
+
static int __init ipv4_offload_init(void)
{
/*
@@ -1774,9 +1779,10 @@ static int __init ipv4_offload_init(void)
pr_crit("%s: Cannot add UDP protocol offload\n", __func__);
if (tcpv4_offload_init() < 0)
pr_crit("%s: Cannot add TCP protocol offload\n", __func__);
+ if (ipip_offload_init() < 0)
+ pr_crit("%s: Cannot add IPIP protocol offload\n", __func__);
dev_add_offload(&ip_packet_offload);
- inet_add_offload(&ipip_offload, IPPROTO_IPIP);
return 0;
}