Skip to content

Commit b802190

Browse files
Merge pull request #38 from LarryLaffer-dev/fix_compilation
Remove duplicate code
2 parents c8cf6fd + 5fb909d commit b802190

File tree

2 files changed

+0
-43
lines changed

2 files changed

+0
-43
lines changed

modules/proto_ipsec/ipsec.c

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -661,38 +661,6 @@ static_assert(sizeof(struct xfrm_algo_osips) == sizeof(struct xfrm_algo)
661661
#define XFRM_OFFLOAD_PACKET 2
662662
#endif
663663

664-
/* Hardware offload state */
665-
int ipsec_hw_offload_ifindex = 0; /* 0 = disabled */
666-
int ipsec_hw_offload_enabled = 0; /* Runtime flag */
667-
668-
/*
669-
* Initialize hardware offload by resolving interface name to index
670-
* Returns: 0 on success, -1 on error
671-
*/
672-
int ipsec_hw_offload_init(const char *ifname)
673-
{
674-
unsigned int ifindex;
675-
676-
if (!ifname || !ifname[0]) {
677-
ipsec_hw_offload_ifindex = 0;
678-
ipsec_hw_offload_enabled = 0;
679-
return 0;
680-
}
681-
682-
ifindex = if_nametoindex(ifname);
683-
if (ifindex == 0) {
684-
LM_ERR("Hardware offload: interface '%s' not found: %s\n",
685-
ifname, strerror(errno));
686-
return -1;
687-
}
688-
689-
ipsec_hw_offload_ifindex = ifindex;
690-
ipsec_hw_offload_enabled = 1;
691-
LM_INFO("Hardware offload enabled on interface '%s' (index %u)\n",
692-
ifname, ifindex);
693-
return 0;
694-
}
695-
696664
/*
697665
* Structure for XFRM hardware offload (xfrm_user_offload)
698666
* This is defined in linux/xfrm.h but may not be available on older kernels

modules/proto_ipsec/ipsec.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -160,17 +160,6 @@ void ipsec_ctx_remove_tmp(struct ipsec_ctx *ctx);
160160
void ipsec_ctx_remove_free_tmp(struct ipsec_ctx *ctx, int _free);
161161
void ipsec_ctx_extend_tmp(struct ipsec_ctx *ctx);
162162

163-
/*
164-
* Hardware Offload support for IPSec
165-
* Modern NICs (e.g., Mellanox ConnectX, Intel QAT) can offload
166-
* ESP encryption/decryption to hardware for better performance.
167-
*/
168-
extern int ipsec_hw_offload_ifindex; /* Interface index for HW offload, 0 = disabled */
169-
extern int ipsec_hw_offload_enabled; /* Runtime flag if offload is active */
170-
171-
/* Initialize hardware offload (resolve interface name to index) */
172-
int ipsec_hw_offload_init(const char *ifname);
173-
174163
/*
175164
* NAT-T UDP Encapsulation Socket Management
176165
*

0 commit comments

Comments
 (0)