添加cmsg信息时,对IP报文长度进行检查

This commit is contained in:
崔一鸣
2019-06-14 21:40:04 +08:00
parent 02abbae3d9
commit 65b81fb457
3 changed files with 32 additions and 20 deletions

View File

@@ -306,7 +306,7 @@ MESA_htable_handle kni_create_htable(const char *profile, const char *section, v
return htable;
}
char* kni_ipv4_errmsg_get(int _errno){
char* kni_ipv4_errmsg_get(enum kni_ipv4hdr_parse_error _errno){
switch(_errno){
case KNI_IPV4HDR_PARSE_ERROR_NULL_PACKET:
return (char*)"null packet";
@@ -315,7 +315,7 @@ char* kni_ipv4_errmsg_get(int _errno){
}
}
char* kni_ipv6_errmsg_get(int _errno){
char* kni_ipv6_errmsg_get(enum kni_ipv6hdr_parse_error _errno){
switch(_errno){
case KNI_IPV6HDR_PARSE_ERROR_NULL_PACKET:
return (char*)"null packet";