Changeset 10957


Ignore:
Timestamp:
11/19/08 19:45:58 (4 years ago)
Author:
eko
Message:

alowed remote admin ip (seems something wrong with validator, doesn't saves IP ?? ) Will fix tomorrow.

Location:
src/router/httpd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/router/httpd/modules/broadcom.c

    r10932 r10957  
    328328                    { 
    329329                        tmp->validatename = "validate_wan_ipaddr"; 
     330                    } 
     331                    if( !stricmp( tmpstr, "MERGEREMOTEIP" ) ) 
     332                    { 
     333                        tmp->validatename = "validate_remote_ip"; 
     334                        tmp->argv = 
     335                            ( char ** )malloc( sizeof( char ** ) * 2 ); 
     336                        tmp->argv[0] = getFileString( in ); 
     337                        tmp->argv[1] = NULL; 
    330338                    } 
    331339                    if( !stricmp( tmpstr, "MERGEIPADDRS" ) ) 
  • src/router/httpd/validate/validators.c

    r10731 r10957  
    878878} 
    879879 
     880void 
     881validate_remote_ip(webs_t wp, char *value, struct variable *v) 
     882{ 
     883        char from[20], *to; 
     884        char remote_ip[254]; 
     885 
     886                get_merge_ipaddr(wp, v->name, from);             
     887                to = websGetVar(wp, "remote_ip_4", NULL); 
     888                 
     889                if( !valid_ipaddr( wp, from, v ) ) 
     890                return; 
     891 
     892                snprintf(remote_ip, sizeof(remote_ip), "%s %s", from, to); 
     893                nvram_set("remote_ip", remote_ip); 
     894 
     895} 
     896 
     897 
    880898#define SRL_VALID(v)        (((v) > 0) && ((v) <= 15)) 
    881899#define SFBL_VALID(v)       (((v) > 0) && ((v) <= 15)) 
Note: See TracChangeset for help on using the changeset viewer.