parent
8756177690
commit
3121ffeecb
|
@ -54,7 +54,7 @@ int isBroadcastIpV4Addr(const char *ipAddr)
|
|||
|
||||
if((NULL == ipAddr) || (0 == strlen(ipAddr)))
|
||||
{
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(4 == sscanf(ipAddr,"%d.%d.%d.%d", &ip_part_1, &ip_part_2, &ip_part_3, &ip_part_4))
|
||||
|
@ -62,11 +62,11 @@ int isBroadcastIpV4Addr(const char *ipAddr)
|
|||
if((ip_part_1 = 255) &&(ip_part_2 = 255) &&
|
||||
(ip_part_3 = 255) &&(ip_part_4 = 255))
|
||||
{
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int isIpV4Addr(const char *ipAddr)
|
||||
|
@ -551,7 +551,7 @@ ret_code freeauth_config_add_proc(uint source, uint config_type,
|
|||
inet_ntop(AF_INET,&freeauth_configure->sip, str, sizeof(str));
|
||||
|
||||
printf("%s\n", str);
|
||||
/*校验源ip地址*/
|
||||
/*校验源ip地址 两种错误情况:ip地址不符合返回值为1 ip地址为255.255.255.255 返回值为1*/
|
||||
if((1 == isIpV4Addr(str)) || (0 == isBroadcastIpV4Addr(str)) ) {
|
||||
char *ret_char = NULL;
|
||||
unsigned int ret_int = 0;
|
||||
|
|
Loading…
Reference in New Issue