Skip to content

Commit 0b28adb

Browse files
committed
[201911] Support vrf mgmt for aaa
Consider if the socket is bound to a device when binding.
1 parent e4f44e4 commit 0b28adb

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

patch/Support-aaa-for-mgmt-vrf.patch

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From 62228e8a35770a9f7059533acb51846872c03777 Mon Sep 17 00:00:00 2001
2+
From: inspurSDN <[email protected]>
3+
Date: Tue, 1 Mar 2022 14:38:35 +0000
4+
Subject: [PATCH] Consider if the socket is bound to a device when binding.
5+
6+
---
7+
net/core/sock.c | 2 +-
8+
1 file changed, 1 insertion(+), 1 deletion(-)
9+
10+
diff --git a/net/core/sock.c b/net/core/sock.c
11+
index 4d60e7fc..ef504469 100644
12+
--- a/net/core/sock.c
13+
+++ b/net/core/sock.c
14+
@@ -534,7 +534,7 @@ static int sock_setbindtodevice(struct sock *sk, char __user *optval,
15+
16+
/* Sorry... */
17+
ret = -EPERM;
18+
- if (!ns_capable(net->user_ns, CAP_NET_RAW))
19+
+ if (sk->sk_bound_dev_if && !ns_capable(net->user_ns, CAP_NET_RAW))
20+
goto out;
21+
22+
ret = -EINVAL;
23+
--
24+
2.17.1
25+

patch/series

+1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ driver-ixgbe-external-phy.patch
132132
fix_ismt_alignment_issue.patch
133133
net-psample-module-unload.patch
134134
config-sensor-mp2975.patch
135+
Support-aaa-for-mgmt-vrf.patch
135136
#
136137
# This series applies on GIT commit 1451b36b2b0d62178e42f648d8a18131af18f7d8
137138
# Tkernel-sched-core-fix-cgroup-fork-race.patch

0 commit comments

Comments
 (0)