IPVS: Merge AH and ESP support into one file
Subsystems (3)
cover IPVS: Merge AH and ESP support into one file
These patches remove the duplication between ip_vs_proto_ah.c and ip_vs_proto_esp.c by merging the same functionality into one file, ip_vs_proto_ah_esp.c.
The original files are almost 100% identical, except for names, constants, etc., which either referenced AH or ESP. This was brought up by Brian Haley when I duplicated even more in those files in the IPVS IPv6 patches. Maybe there's some interest in keeping the files apart though, so feel free to ignore this then.
Julius
PATCH 1/2 IPVS: Integrate ESP protocol into ip_vs_proto_ah.c
Rename all ah_* functions to ah_esp_* (and adjust comments). Move ESP protocol definition into ip_vs_proto_ah.c and remove all usage of ip_vs_proto_esp.c.
Make the compilation of ip_vs_proto_ah.c dependent on a new config variable, IP_VS_PROTO_AH_ESP, which is selected either by IP_VS_PROTO_ESP or IP_VS_PROTO_AH. Only compile the selected protocols' structures within this file.
3 files changed, 54 insertions(+), 24 deletions(-)
net/ipv4/ipvs/Kconfig +6 -0
@@ -71,14 +71,20 @@ config IP_VS_PROTO_UDP This option enables support for load balancing UDP transport protocol. Say Y if unsure. +config IP_VS_PROTO_AH_ESP + bool + depends on UNDEFINED + config IP_VS_PROTO_ESP bool "ESP load balancing support" + select IP_VS_PROTO_AH_ESP ---help--- This option enables support for load balancing ESP (Encapsulation Security Payload) transport protocol. Say Y if unsure. config IP_VS_PROTO_AH bool "AH load balancing support" + select IP_VS_PROTO_AH_ESP ---help--- This option enables support for load balancing AH (Authentication Header) transport protocol. Say Y if unsure.
net/ipv4/ipvs/Makefile +1 -2
@@ -6,8 +6,7 @@ ip_vs_proto-objs-y := ip_vs_proto-objs-$(CONFIG_IP_VS_PROTO_TCP) += ip_vs_proto_tcp.o ip_vs_proto-objs-$(CONFIG_IP_VS_PROTO_UDP) += ip_vs_proto_udp.o -ip_vs_proto-objs-$(CONFIG_IP_VS_PROTO_ESP) += ip_vs_proto_esp.o -ip_vs_proto-objs-$(CONFIG_IP_VS_PROTO_AH) += ip_vs_proto_ah.o +ip_vs_proto-objs-$(CONFIG_IP_VS_PROTO_AH_ESP) += ip_vs_proto_ah.o ip_vs-objs := ip_vs_conn.o ip_vs_core.o ip_vs_ctl.o ip_vs_sched.o \ ip_vs_xmit.o ip_vs_app.o ip_vs_sync.o \
net/ipv4/ipvs/ip_vs_proto_ah.c +47 -22
126 lines not on this page · raw message
Signature · 1 line
1.5.4.5
PATCH 2/2 IPVS: Rename ip_vs_proto_ah.c to ip_vs_proto_ah_esp.c
In reply to Julius VolzAfter integrating ESP into ip_vs_proto_ah, rename it (and the references to it) to ip_vs_proto_ah_esp.c and delete the old ip_vs_proto_esp.c.
4 files changed, 204 insertions(+), 380 deletions(-)
net/ipv4/ipvs/Makefile +1 -1
@@ -6,7 +6,7 @@ ip_vs_proto-objs-y := ip_vs_proto-objs-$(CONFIG_IP_VS_PROTO_TCP) += ip_vs_proto_tcp.o ip_vs_proto-objs-$(CONFIG_IP_VS_PROTO_UDP) += ip_vs_proto_udp.o -ip_vs_proto-objs-$(CONFIG_IP_VS_PROTO_AH_ESP) += ip_vs_proto_ah.o +ip_vs_proto-objs-$(CONFIG_IP_VS_PROTO_AH_ESP) += ip_vs_proto_ah_esp.o ip_vs-objs := ip_vs_conn.o ip_vs_core.o ip_vs_ctl.o ip_vs_sched.o \ ip_vs_xmit.o ip_vs_app.o ip_vs_sync.o \
net/ipv4/ipvs/ip_vs_proto_ah.c deleted +0 -203
203 lines not on this page · raw message
net/ipv4/ipvs/ip_vs_proto_ah_esp.c new file +203 -0
203 lines not on this page · raw message
net/ipv4/ipvs/ip_vs_proto_esp.c deleted +0 -176
176 lines not on this page · raw message
Signature · 1 line
1.5.4.5
Simon Horman
maintainerQuoted 9 lines · Julius Volz
These patches remove the duplication between
ip_vs_proto_ah.candip_vs_proto_esp.cby merging the same functionality into one file,ip_vs_proto_ah_esp.c.The original files are almost 100% identical, except for names, constants, etc., which either referenced AH or ESP. This was brought up by Brian Haley when I duplicated even more in those files in the IPVS IPv6 patches. Maybe there's some interest in keeping the files apart though, so feel free to ignore this then.
Hi Julius,
these changes look good to me. I have pushed them into lvs-2.6. The master branch is based on net-2.6. The lvs-next-2.6 branch is based on net-next.2.6.