Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xfrm: remove hdr_offset indirection

After previous patches all remaining users set the function pointer to
the same function: xfrm6_find_1stfragopt.

So remove this function pointer and call ip6_find_1stfragopt directly.

Reduces size of xfrm_type to 64 bytes on 64bit platforms.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>

authored by

Florian Westphal and committed by
Steffen Klassert
d1002d24 848b18fb

+1 -14
-3
include/net/xfrm.h
··· 402 402 int (*output)(struct xfrm_state *, struct sk_buff *pskb); 403 403 int (*reject)(struct xfrm_state *, struct sk_buff *, 404 404 const struct flowi *); 405 - int (*hdr_offset)(struct xfrm_state *, struct sk_buff *, u8 **); 406 405 }; 407 406 408 407 int xfrm_register_type(const struct xfrm_type *type, unsigned short family); ··· 1604 1605 __be32 xfrm6_tunnel_spi_lookup(struct net *net, const xfrm_address_t *saddr); 1605 1606 int xfrm6_output(struct net *net, struct sock *sk, struct sk_buff *skb); 1606 1607 int xfrm6_output_finish(struct sock *sk, struct sk_buff *skb); 1607 - int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb, 1608 - u8 **prevhdr); 1609 1608 1610 1609 #ifdef CONFIG_XFRM 1611 1610 void xfrm6_local_rxpmtu(struct sk_buff *skb, u32 mtu);
-1
net/ipv6/ah6.c
··· 762 762 .destructor = ah6_destroy, 763 763 .input = ah6_input, 764 764 .output = ah6_output, 765 - .hdr_offset = xfrm6_find_1stfragopt, 766 765 }; 767 766 768 767 static struct xfrm6_protocol ah6_protocol = {
-1
net/ipv6/esp6.c
··· 1250 1250 .destructor = esp6_destroy, 1251 1251 .input = esp6_input, 1252 1252 .output = esp6_output, 1253 - .hdr_offset = xfrm6_find_1stfragopt, 1254 1253 }; 1255 1254 1256 1255 static struct xfrm6_protocol esp6_protocol = {
-1
net/ipv6/ipcomp6.c
··· 178 178 .destructor = ipcomp_destroy, 179 179 .input = ipcomp_input, 180 180 .output = ipcomp_output, 181 - .hdr_offset = xfrm6_find_1stfragopt, 182 181 }; 183 182 184 183 static struct xfrm6_protocol ipcomp6_protocol = {
-7
net/ipv6/xfrm6_output.c
··· 16 16 #include <net/ip6_route.h> 17 17 #include <net/xfrm.h> 18 18 19 - int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb, 20 - u8 **prevhdr) 21 - { 22 - return ip6_find_1stfragopt(skb, prevhdr); 23 - } 24 - EXPORT_SYMBOL(xfrm6_find_1stfragopt); 25 - 26 19 void xfrm6_local_rxpmtu(struct sk_buff *skb, u32 mtu) 27 20 { 28 21 struct flowi6 fl6;
+1 -1
net/xfrm/xfrm_output.c
··· 185 185 break; 186 186 } 187 187 188 - return x->type->hdr_offset(x, skb, prevhdr); 188 + return ip6_find_1stfragopt(skb, prevhdr); 189 189 } 190 190 191 191 /* Add encapsulation header.