aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_gss
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/auth_gss')
-rw-r--r--net/sunrpc/auth_gss/gss_mech_switch.c14
-rw-r--r--net/sunrpc/auth_gss/svcauth_gss.c2
2 files changed, 16 insertions, 0 deletions
diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c
index 26872517ccf3..61801a069ff0 100644
--- a/net/sunrpc/auth_gss/gss_mech_switch.c
+++ b/net/sunrpc/auth_gss/gss_mech_switch.c
@@ -194,6 +194,20 @@ gss_mech_get_by_pseudoflavor(u32 pseudoflavor)
194EXPORT_SYMBOL(gss_mech_get_by_pseudoflavor); 194EXPORT_SYMBOL(gss_mech_get_by_pseudoflavor);
195 195
196u32 196u32
197gss_svc_to_pseudoflavor(struct gss_api_mech *gm, u32 service)
198{
199 int i;
200
201 for (i = 0; i < gm->gm_pf_num; i++) {
202 if (gm->gm_pfs[i].service == service) {
203 return gm->gm_pfs[i].pseudoflavor;
204 }
205 }
206 return RPC_AUTH_MAXFLAVOR; /* illegal value */
207}
208EXPORT_SYMBOL(gss_svc_to_pseudoflavor);
209
210u32
197gss_pseudoflavor_to_service(struct gss_api_mech *gm, u32 pseudoflavor) 211gss_pseudoflavor_to_service(struct gss_api_mech *gm, u32 pseudoflavor)
198{ 212{
199 int i; 213 int i;
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index c094583386fd..7a3e1758bea1 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -1131,6 +1131,8 @@ svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp)
1131 } 1131 }
1132 svcdata->rsci = rsci; 1132 svcdata->rsci = rsci;
1133 cache_get(&rsci->h); 1133 cache_get(&rsci->h);
1134 rqstp->rq_flavor = gss_svc_to_pseudoflavor(
1135 rsci->mechctx->mech_type, gc->gc_svc);
1134 ret = SVC_OK; 1136 ret = SVC_OK;
1135 goto out; 1137 goto out;
1136 } 1138 }