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

Commit 41b42761 authored by Tyler Wear's avatar Tyler Wear Committed by Ravinder Konka
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 avatarTyler Wear <twear@codeaurora.org>
parent 3cecced0
Loading
Loading
Loading
Loading
+8 −5
Original line number Original line Diff line number Diff line
@@ -47,15 +47,11 @@ module_param(sip_direct_signalling, int, 0600);
MODULE_PARM_DESC(sip_direct_signalling, "expect incoming calls from registrar "
MODULE_PARM_DESC(sip_direct_signalling, "expect incoming calls from registrar "
					"only (default 1)");
					"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;
const struct nf_nat_sip_hooks *nf_nat_sip_hooks;
EXPORT_SYMBOL_GPL(nf_nat_sip_hooks);
EXPORT_SYMBOL_GPL(nf_nat_sip_hooks);
static struct ctl_table_header *sip_sysctl_header;
static struct ctl_table_header *sip_sysctl_header;
static unsigned nf_ct_disable_sip_alg;
static unsigned nf_ct_disable_sip_alg;
static int sip_direct_media = 1;
static struct ctl_table sip_sysctl_tbl[] = {
static struct ctl_table sip_sysctl_tbl[] = {
	{
	{
		.procname     = "nf_conntrack_disable_sip_alg",
		.procname     = "nf_conntrack_disable_sip_alg",
@@ -64,6 +60,13 @@ static struct ctl_table sip_sysctl_tbl[] = {
		.mode         = 0644,
		.mode         = 0644,
		.proc_handler = proc_dointvec,
		.proc_handler = proc_dointvec,
	},
	},
	{
		.procname     = "nf_conntrack_sip_direct_media",
		.data         = &sip_direct_media,
		.maxlen       = sizeof(int),
		.mode         = 0644,
		.proc_handler = proc_dointvec,
	},
	{}
	{}
};
};