kni初始化失败直接exit
This commit is contained in:
@@ -15,6 +15,9 @@
|
||||
#include "Maat_rule.h"
|
||||
#include "Maat_command.h"
|
||||
#include "mrtunnat.h"
|
||||
#include <sys/ioctl.h>
|
||||
#include <netinet/ip6.h>
|
||||
#include <net/if.h>
|
||||
|
||||
#define KNI_STRING_MAX 2048
|
||||
#define KNI_PATH_MAX 256
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
#include "kni_utils.h"
|
||||
#include <sys/ioctl.h>
|
||||
#include <netinet/ip6.h>
|
||||
#include <net/if.h>
|
||||
|
||||
int kni_addr_trans_v4(struct stream_tuple4_v4 *tuple4, char *output, int len){
|
||||
char saddr[INET_ADDRSTRLEN];
|
||||
|
||||
@@ -1010,6 +1010,7 @@ static int first_data_intercept(struct streaminfo *stream, struct pme_info *pmei
|
||||
pmeinfo->error = STREAM_ERROR_TUPLE2STM_ADD_FAIL;
|
||||
return APP_STATE_FAWPKT | APP_STATE_DROPME;
|
||||
}
|
||||
|
||||
//only intercept: add to traceid2pme htable
|
||||
traceid2pme_htable_add(pmeinfo);
|
||||
//action = KNI_ACTION_INTERCEPT, sendto tfe
|
||||
@@ -1461,10 +1462,11 @@ int tuple2stream_htable_search(MESA_htable_handle handle, struct ethhdr *ether_h
|
||||
return -1;
|
||||
}
|
||||
FS_operate(g_kni_fs_handle->handle, g_kni_fs_handle->fields[KNI_FIELD_TUPLE2STM_SEARCH_SUCC], 0, FS_OP_ADD, 1);
|
||||
unsigned char dir = value->stream->routedir;
|
||||
if(reversed == value->reversed){
|
||||
dir = MESA_dir_reverse(value->stream->routedir);
|
||||
unsigned char dir = value->route_dir;
|
||||
if(reversed != value->reversed){
|
||||
dir = MESA_dir_reverse(dir);
|
||||
}
|
||||
|
||||
ret = sapp_inject_pkt(value->stream, SIO_EXCLUDE_THIS_LAYER_HDR, raw_packet, pktinfo.ip_totlen, dir);
|
||||
if(ret < 0){
|
||||
KNI_LOG_ERROR(logger, "Failed at sapp_inject_pkt, stream addr = %s", key_str);
|
||||
@@ -2158,5 +2160,5 @@ extern "C" int kni_init(){
|
||||
|
||||
error_out:
|
||||
kni_destroy(g_kni_handle);
|
||||
return -1;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user