Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f76274af authored by Tyler Wear's avatar Tyler Wear Committed by Gerrit - the friendly Code Review server
Browse files

netfilter: nf_conntrack_sip: Dynamically enable/disable SIP direct media.



Enabling SIP direct media allows flow of SIP media traffic only between
the SIP signalling end points. Disabling SIP direct media allows flow of
SIP media traffic between 2 SIP clients which interact with each other
with the help of SIP server as the intermediate entity, which is the more
common usecase. This change allows easy way to enable/disable SIP direct
media from userspace to cater to the more common usecase.

Change-Id: Iadfd7062e48c8b4e2f7af919a6062360c165344c
Signed-off-by: default avatarMohammed Javid <mjavid@codeaurora.org>
Acked-by: default avatarSneha <smaganah@qti.qualcomm.com>
parent f0f1c4aa
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -49,15 +49,11 @@ module_param(sip_direct_signalling, int, 0600);
MODULE_PARM_DESC(sip_direct_signalling, "expect incoming calls from registrar "
					"only (default 1)");

static int sip_direct_media __read_mostly = 1;
module_param(sip_direct_media, int, 0600);
MODULE_PARM_DESC(sip_direct_media, "Expect Media streams between signalling "
				   "endpoints only (default 1)");

const struct nf_nat_sip_hooks *nf_nat_sip_hooks;
EXPORT_SYMBOL_GPL(nf_nat_sip_hooks);
static struct ctl_table_header *sip_sysctl_header;
static unsigned int nf_ct_disable_sip_alg;
static int sip_direct_media = 1;
static struct ctl_table sip_sysctl_tbl[] = {
	{
		.procname     = "nf_conntrack_disable_sip_alg",
@@ -66,6 +62,13 @@ static struct ctl_table sip_sysctl_tbl[] = {
		.mode         = 0644,
		.proc_handler = proc_dointvec,
	},
	{
		.procname     = "nf_conntrack_sip_direct_media",
		.data         = &sip_direct_media,
		.maxlen       = sizeof(int),
		.mode         = 0644,
		.proc_handler = proc_dointvec,
	},
	{}
};