summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author杨威 <[email protected]>2023-07-18 14:18:03 +0800
committer杨威 <[email protected]>2023-07-18 14:18:34 +0800
commite3a774c6798596b917425640cc1b84b506df0238 (patch)
tree9e369c14c63407675d20a74fdf70eba650a59746
parent42b475e4b8635199347def3ff3cb07591d45a41d (diff)
🐞 fix(ipv6_entry): 调整ipv6判断上层承载协议的逻辑,对于未知类型默认执行passv4.3.15
增加对OSPF IGP报文的判断,同ESP报文逻辑一致,直接调用ipv6插件入口
-rw-r--r--include/private/deal_ipv6.h1
-rw-r--r--src/dealpkt/deal_ipv6.c11
2 files changed, 3 insertions, 9 deletions
diff --git a/include/private/deal_ipv6.h b/include/private/deal_ipv6.h
index fa8035a..9bbfa24 100644
--- a/include/private/deal_ipv6.h
+++ b/include/private/deal_ipv6.h
@@ -59,6 +59,7 @@ struct simple_ip6_hdr
#define NEXTHDR_ICMP 58 /* ICMP for IPv6. */
#define NEXTHDR_NONE 59 /* No next header */
#define NEXTHDR_DEST 60 /* Destination options header. */
+#define NEXTHDR_OSPF_IGP 89 /* Destination options header. */
#define NEXTHDR_MOBILITY 135 /* Mobility header. */
struct ipv6_opt_hdr{
diff --git a/src/dealpkt/deal_ipv6.c b/src/dealpkt/deal_ipv6.c
index b93d526..58e084a 100644
--- a/src/dealpkt/deal_ipv6.c
+++ b/src/dealpkt/deal_ipv6.c
@@ -935,6 +935,7 @@ int ipv6_entry(struct streaminfo_private *pfstream_pr, const void *this_layer_hd
goto done;
break;
+ case NEXTHDR_OSPF_IGP:
case NEXTHDR_ESP:
ret=stream_process_ipv6(plocal_stream,(const struct ip6_hdr *)a_packet,thread_num,routedir, raw_pkt);
if(ret==DROP){
@@ -947,7 +948,7 @@ int ipv6_entry(struct streaminfo_private *pfstream_pr, const void *this_layer_hd
local_sys_stat->count[SAPP_STAT_RCV_UNKNOWN]++;
local_sys_stat->length[SAPP_STAT_RCV_UNKNOWN]+=raw_pkt->raw_pkt_len;
sapp_runtime_log(20, "unsupport Ipv6 protocol:%u!\n", next_hdr_type);
- goto err_exit;
+ goto done;
break;
}
@@ -958,21 +959,13 @@ int ipv6_entry(struct streaminfo_private *pfstream_pr, const void *this_layer_hd
done:
if(unlikely(need_free)){
-#if (0 == HIGH_PERF)
- raw_frags_list_free_global(thread_num, __ADDR_TYPE_IP_PAIR_V6);
-#endif
sapp_mem_free(SAPP_MEM_DYN_IP_FRAG_PKT,thread_num, new_ip6h);
}
-
return action;
prosecc_pkt_drop:
-err_exit:
if(need_free)
{
-#if (0 == HIGH_PERF)
- raw_frags_list_free_global(thread_num, __ADDR_TYPE_IP_PAIR_V6);
-#endif
sapp_mem_free(SAPP_MEM_DYN_IP_FRAG_PKT,thread_num, new_ip6h);
}