mirror of https://github.com/dynup/kpatch
149 lines
4.9 KiB
Diff
149 lines
4.9 KiB
Diff
diff -Nupr src.orig/net/ipv4/fib_frontend.c src/net/ipv4/fib_frontend.c
|
|
--- src.orig/net/ipv4/fib_frontend.c 2020-05-12 11:14:29.710771918 -0400
|
|
+++ src/net/ipv4/fib_frontend.c 2020-05-12 11:15:48.047376894 -0400
|
|
@@ -789,6 +789,7 @@ errout:
|
|
return err;
|
|
}
|
|
|
|
+#include "kpatch-macros.h"
|
|
static int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh,
|
|
struct netlink_ext_ack *extack)
|
|
{
|
|
@@ -810,6 +811,7 @@ static int inet_rtm_newroute(struct sk_b
|
|
err = fib_table_insert(net, tb, &cfg, extack);
|
|
if (!err && cfg.fc_type == RTN_LOCAL)
|
|
net->ipv4.fib_has_custom_local_routes = true;
|
|
+ KPATCH_PRINTK("[inet_rtm_newroute]: err is %d\n", err);
|
|
errout:
|
|
return err;
|
|
}
|
|
diff -Nupr src.orig/net/ipv4/fib_semantics.c src/net/ipv4/fib_semantics.c
|
|
--- src.orig/net/ipv4/fib_semantics.c 2020-05-12 11:14:29.710771918 -0400
|
|
+++ src/net/ipv4/fib_semantics.c 2020-05-12 11:15:48.047376894 -0400
|
|
@@ -1025,6 +1025,7 @@ fib_convert_metrics(struct fib_info *fi,
|
|
fi->fib_metrics->metrics);
|
|
}
|
|
|
|
+#include "kpatch-macros.h"
|
|
struct fib_info *fib_create_info(struct fib_config *cfg,
|
|
struct netlink_ext_ack *extack)
|
|
{
|
|
@@ -1058,6 +1059,7 @@ struct fib_info *fib_create_info(struct
|
|
#endif
|
|
|
|
err = -ENOBUFS;
|
|
+ KPATCH_PRINTK("[fib_create_info]: create error err is %d\n",err);
|
|
if (fib_info_cnt >= fib_info_hash_size) {
|
|
unsigned int new_size = fib_info_hash_size << 1;
|
|
struct hlist_head *new_info_hash;
|
|
@@ -1078,6 +1080,7 @@ struct fib_info *fib_create_info(struct
|
|
if (!fib_info_hash_size)
|
|
goto failure;
|
|
}
|
|
+ KPATCH_PRINTK("[fib_create_info]: 2 create error err is %d\n",err);
|
|
|
|
fi = kzalloc(sizeof(*fi)+nhs*sizeof(struct fib_nh), GFP_KERNEL);
|
|
if (!fi)
|
|
@@ -1093,6 +1096,8 @@ struct fib_info *fib_create_info(struct
|
|
fi->fib_metrics = (struct dst_metrics *)&dst_default_metrics;
|
|
}
|
|
fib_info_cnt++;
|
|
+ KPATCH_PRINTK("[fib_create_info]: 3 create error err is %d\n",err);
|
|
+
|
|
fi->fib_net = net;
|
|
fi->fib_protocol = cfg->fc_protocol;
|
|
fi->fib_scope = cfg->fc_scope;
|
|
@@ -1109,8 +1114,10 @@ struct fib_info *fib_create_info(struct
|
|
if (!nexthop_nh->nh_pcpu_rth_output)
|
|
goto failure;
|
|
} endfor_nexthops(fi)
|
|
+ KPATCH_PRINTK("[fib_create_info]: 4 create error err is %d\n",err);
|
|
|
|
err = fib_convert_metrics(fi, cfg);
|
|
+ KPATCH_PRINTK("[fib_create_info]: 5 create error err is %d\n",err);
|
|
if (err)
|
|
goto failure;
|
|
|
|
@@ -1172,6 +1179,7 @@ struct fib_info *fib_create_info(struct
|
|
nh->nh_weight = 1;
|
|
#endif
|
|
}
|
|
+ KPATCH_PRINTK("[fib_create_info]: 6 create error err is %d\n",err);
|
|
|
|
if (fib_props[cfg->fc_type].error) {
|
|
if (cfg->fc_gw || cfg->fc_oif || cfg->fc_mp) {
|
|
@@ -1193,6 +1201,7 @@ struct fib_info *fib_create_info(struct
|
|
goto err_inval;
|
|
}
|
|
}
|
|
+ KPATCH_PRINTK("[fib_create_info]: 7 create error err is %d\n",err);
|
|
|
|
if (cfg->fc_scope > RT_SCOPE_HOST) {
|
|
NL_SET_ERR_MSG(extack, "Invalid scope");
|
|
@@ -1231,6 +1240,7 @@ struct fib_info *fib_create_info(struct
|
|
if (linkdown == fi->fib_nhs)
|
|
fi->fib_flags |= RTNH_F_LINKDOWN;
|
|
}
|
|
+ KPATCH_PRINTK("[fib_create_info]: 8 create error err is %d\n",err);
|
|
|
|
if (fi->fib_prefsrc && !fib_valid_prefsrc(cfg, fi->fib_prefsrc)) {
|
|
NL_SET_ERR_MSG(extack, "Invalid prefsrc address");
|
|
@@ -1240,6 +1250,7 @@ struct fib_info *fib_create_info(struct
|
|
change_nexthops(fi) {
|
|
fib_info_update_nh_saddr(net, nexthop_nh);
|
|
} endfor_nexthops(fi)
|
|
+ KPATCH_PRINTK("[fib_create_info]: 9 create error err is %d\n",err);
|
|
|
|
fib_rebalance(fi);
|
|
|
|
@@ -1251,6 +1262,7 @@ link_it:
|
|
ofi->fib_treeref++;
|
|
return ofi;
|
|
}
|
|
+ KPATCH_PRINTK("[fib_create_info]: 10 create error err is %d\n",err);
|
|
|
|
fi->fib_treeref++;
|
|
refcount_set(&fi->fib_clntref, 1);
|
|
@@ -1274,6 +1286,7 @@ link_it:
|
|
hlist_add_head(&nexthop_nh->nh_hash, head);
|
|
} endfor_nexthops(fi)
|
|
spin_unlock_bh(&fib_info_lock);
|
|
+ KPATCH_PRINTK("[fib_create_info]: 11 create error err is %d\n",err);
|
|
return fi;
|
|
|
|
err_inval:
|
|
@@ -1284,6 +1297,7 @@ failure:
|
|
fi->fib_dead = 1;
|
|
free_fib_info(fi);
|
|
}
|
|
+ KPATCH_PRINTK("[fib_create_info]: 12 create error err is %d\n",err);
|
|
|
|
return ERR_PTR(err);
|
|
}
|
|
diff -Nupr src.orig/net/ipv4/fib_trie.c src/net/ipv4/fib_trie.c
|
|
--- src.orig/net/ipv4/fib_trie.c 2020-05-12 11:14:29.710771918 -0400
|
|
+++ src/net/ipv4/fib_trie.c 2020-05-12 11:15:48.047376894 -0400
|
|
@@ -1121,6 +1121,7 @@ static bool fib_valid_key_len(u32 key, u
|
|
}
|
|
|
|
/* Caller must hold RTNL. */
|
|
+#include "kpatch-macros.h"
|
|
int fib_table_insert(struct net *net, struct fib_table *tb,
|
|
struct fib_config *cfg, struct netlink_ext_ack *extack)
|
|
{
|
|
@@ -1143,11 +1144,14 @@ int fib_table_insert(struct net *net, st
|
|
|
|
pr_debug("Insert table=%u %08x/%d\n", tb->tb_id, key, plen);
|
|
|
|
+ KPATCH_PRINTK("[fib_table_insert]: start\n");
|
|
fi = fib_create_info(cfg, extack);
|
|
if (IS_ERR(fi)) {
|
|
err = PTR_ERR(fi);
|
|
+ KPATCH_PRINTK("[fib_table_insert]: create error err is %d\n",err);
|
|
goto err;
|
|
}
|
|
+ KPATCH_PRINTK("[fib_table_insert]: cross\n");
|
|
|
|
l = fib_find_node(t, &tp, key);
|
|
fa = l ? fib_find_alias(&l->leaf, slen, tos, fi->fib_priority,
|