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

Commit 779dfa61 authored by Akshay Pandit's avatar Akshay Pandit
Browse files

msm: ipa_v2: Protect ipa default routing table



Protect ipa default routing table from
addition, deletion and modification once after
default rule added by ipa driver.

Change-Id: I4b8fdd9208425c5eb0bceed0ce62fb7d7a075e36
Signed-off-by: default avatarAkshay Pandit <pandit@codeaurora.org>
parent 22dc337a
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -1066,9 +1066,8 @@ static int __ipa_add_rt_rule(enum ipa_ip_type ip, const char *name,
	 * tables
	 */
	if (!strncmp(tbl->name, IPA_DFLT_RT_TBL_NAME, IPA_RESOURCE_NAME_MAX) &&
	    (tbl->rule_cnt > 0) && (at_rear != 0)) {
		IPAERR("cannot add rule at end of tbl rule_cnt=%d at_rear=%d\n",
		       tbl->rule_cnt, at_rear);
	    (tbl->rule_cnt > 0)) {
		IPAERR("cannot add rules to default rt table\n");
		goto error;
	}

@@ -1605,6 +1604,11 @@ static int __ipa_mdfy_rt_rule(struct ipa_rt_rule_mdfy *rtrule)
		goto error;
	}

	if (!strcmp(entry->tbl->name, IPA_DFLT_RT_TBL_NAME)) {
		IPAERR_RL("Default tbl rule cannot be modified\n");
		return -EINVAL;
	}

	/* Adding check to confirm still
	 * header entry present in header table or not
	 */