Skip to content

Commit 195ad6a

Browse files
herbertxdavem330
authored andcommitted
[IPSEC]: Rename tunnel-mode functions to avoid collisions with tunnels
It appears that I've managed to create two different functions both called xfrm6_tunnel_output. This is because we have the plain tunnel encapsulation named xfrmX_tunnel as well as the tunnel-mode encapsulation which lives in the files xfrmX_mode_tunnel.c. This patch renames functions from the latter to use the xfrmX_mode_tunnel prefix to avoid name-space conflicts. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ad01837 commit 195ad6a

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

net/ipv4/xfrm4_mode_tunnel.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static inline void ipip_ecn_decapsulate(struct sk_buff *skb)
2626
*
2727
* The top IP header will be constructed per RFC 2401.
2828
*/
29-
static int xfrm4_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
29+
static int xfrm4_mode_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
3030
{
3131
struct dst_entry *dst = skb->dst;
3232
struct iphdr *top_iph;
@@ -63,7 +63,7 @@ static int xfrm4_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
6363
return 0;
6464
}
6565

66-
static int xfrm4_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
66+
static int xfrm4_mode_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
6767
{
6868
const unsigned char *old_mac;
6969
int err = -EINVAL;
@@ -94,29 +94,29 @@ static int xfrm4_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
9494
}
9595

9696
static struct xfrm_mode xfrm4_tunnel_mode = {
97-
.input2 = xfrm4_tunnel_input,
97+
.input2 = xfrm4_mode_tunnel_input,
9898
.input = xfrm_prepare_input,
99-
.output2 = xfrm4_tunnel_output,
99+
.output2 = xfrm4_mode_tunnel_output,
100100
.output = xfrm4_prepare_output,
101101
.owner = THIS_MODULE,
102102
.encap = XFRM_MODE_TUNNEL,
103103
.flags = XFRM_MODE_FLAG_TUNNEL,
104104
};
105105

106-
static int __init xfrm4_tunnel_init(void)
106+
static int __init xfrm4_mode_tunnel_init(void)
107107
{
108108
return xfrm_register_mode(&xfrm4_tunnel_mode, AF_INET);
109109
}
110110

111-
static void __exit xfrm4_tunnel_exit(void)
111+
static void __exit xfrm4_mode_tunnel_exit(void)
112112
{
113113
int err;
114114

115115
err = xfrm_unregister_mode(&xfrm4_tunnel_mode, AF_INET);
116116
BUG_ON(err);
117117
}
118118

119-
module_init(xfrm4_tunnel_init);
120-
module_exit(xfrm4_tunnel_exit);
119+
module_init(xfrm4_mode_tunnel_init);
120+
module_exit(xfrm4_mode_tunnel_exit);
121121
MODULE_LICENSE("GPL");
122122
MODULE_ALIAS_XFRM_MODE(AF_INET, XFRM_MODE_TUNNEL);

net/ipv6/xfrm6_mode_tunnel.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static inline void ipip6_ecn_decapsulate(struct sk_buff *skb)
2929
*
3030
* The top IP header will be constructed per RFC 2401.
3131
*/
32-
static int xfrm6_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
32+
static int xfrm6_mode_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
3333
{
3434
struct dst_entry *dst = skb->dst;
3535
struct ipv6hdr *top_iph;
@@ -58,7 +58,7 @@ static int xfrm6_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
5858
return 0;
5959
}
6060

61-
static int xfrm6_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
61+
static int xfrm6_mode_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
6262
{
6363
int err = -EINVAL;
6464
const unsigned char *old_mac;
@@ -89,29 +89,29 @@ static int xfrm6_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
8989
}
9090

9191
static struct xfrm_mode xfrm6_tunnel_mode = {
92-
.input2 = xfrm6_tunnel_input,
92+
.input2 = xfrm6_mode_tunnel_input,
9393
.input = xfrm_prepare_input,
94-
.output2 = xfrm6_tunnel_output,
94+
.output2 = xfrm6_mode_tunnel_output,
9595
.output = xfrm6_prepare_output,
9696
.owner = THIS_MODULE,
9797
.encap = XFRM_MODE_TUNNEL,
9898
.flags = XFRM_MODE_FLAG_TUNNEL,
9999
};
100100

101-
static int __init xfrm6_tunnel_init(void)
101+
static int __init xfrm6_mode_tunnel_init(void)
102102
{
103103
return xfrm_register_mode(&xfrm6_tunnel_mode, AF_INET6);
104104
}
105105

106-
static void __exit xfrm6_tunnel_exit(void)
106+
static void __exit xfrm6_mode_tunnel_exit(void)
107107
{
108108
int err;
109109

110110
err = xfrm_unregister_mode(&xfrm6_tunnel_mode, AF_INET6);
111111
BUG_ON(err);
112112
}
113113

114-
module_init(xfrm6_tunnel_init);
115-
module_exit(xfrm6_tunnel_exit);
114+
module_init(xfrm6_mode_tunnel_init);
115+
module_exit(xfrm6_mode_tunnel_exit);
116116
MODULE_LICENSE("GPL");
117117
MODULE_ALIAS_XFRM_MODE(AF_INET6, XFRM_MODE_TUNNEL);

0 commit comments

Comments
 (0)