summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryangwei <[email protected]>2024-03-20 17:49:29 +0800
committeryangwei <[email protected]>2024-03-20 17:49:29 +0800
commit3dd91440cbacbb8842c88c336a10d4ddf9e1d133 (patch)
tree322b0c391c25ee48c3be8101e1d6ed6d01f1091d
parent7d14b84ee8eaef5270ca91c875e7981d45c6feff (diff)
🐞 fix(MESA_get_stream_opt): 修复in & out route_ctx返回错误
-rw-r--r--src/dealpkt/plug_support.c42
-rw-r--r--stream_public.curdir*0
2 files changed, 26 insertions, 16 deletions
diff --git a/src/dealpkt/plug_support.c b/src/dealpkt/plug_support.c
index 29d078d..11f839b 100644
--- a/src/dealpkt/plug_support.c
+++ b/src/dealpkt/plug_support.c
@@ -1825,33 +1825,43 @@ int MESA_get_stream_opt(const struct streaminfo *pstream, enum MESA_stream_opt o
break;
}
case MSO_STREAM_INBOND_ROUTE_CTX:
- case MSO_STREAM_OUTBOND_ROUTE_CTX:
{
ret = -1;
*opt_val_len = 0;
void **value = (void **)opt_val;
struct rawpkt_metadata *meta = NULL;
- if (pstream_pr->stream_c2s_route_dir == DIR_ROUTE_UP)
+ int dir=MESA_dir_link_to_human(pstream_pr->stream_c2s_route_dir);
+ if (dir==(int)'I')
{
- if (opt == MSO_STREAM_OUTBOND_ROUTE_CTX)
- {
meta = pstream_pr->polling_inject_context->meta_stream_dir[DIR_C2S - 1];
- }
- else
- {
- meta = pstream_pr->polling_inject_context->meta_stream_dir[DIR_S2C - 1];
- }
}
else
{
- if (opt == MSO_STREAM_OUTBOND_ROUTE_CTX)
- {
- meta = pstream_pr->polling_inject_context->meta_stream_dir[DIR_S2C - 1];
- }
- else
- {
+ meta = pstream_pr->polling_inject_context->meta_stream_dir[DIR_S2C - 1];
+ }
+
+ if (meta)
+ {
+ *value = (void *)meta->data;
+ *opt_val_len = meta->sz_data;
+ ret = meta->sz_data;
+ }
+ }
+ break;
+ case MSO_STREAM_OUTBOND_ROUTE_CTX:
+ {
+ ret = -1;
+ *opt_val_len = 0;
+ void **value = (void **)opt_val;
+ struct rawpkt_metadata *meta = NULL;
+ int dir=MESA_dir_link_to_human(pstream_pr->stream_c2s_route_dir);
+ if (dir==(int)'E')
+ {
meta = pstream_pr->polling_inject_context->meta_stream_dir[DIR_C2S - 1];
- }
+ }
+ else
+ {
+ meta = pstream_pr->polling_inject_context->meta_stream_dir[DIR_S2C - 1];
}
if (meta)
diff --git a/stream_public.curdir* b/stream_public.curdir*
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/stream_public.curdir*