Revision e29fa06e filter/filter.c

View differences:

filter/filter.c
137 137
    return 0;
138 138
  case T_PATH_MASK:
139 139
    return pm_path_compare(v1.val.path_mask, v2.val.path_mask);
140
  case T_STRING:
141
    return strcmp(v1.val.s, v2.val.s);
140 142
  default:
141 143
    debug( "Compare of unkown entities: %x\n", v1.type );
142 144
    return CMP_ERROR;
......
153 155
    return as_path_match(v1.val.ad, v2.val.path_mask);
154 156
  if ((v1.type == T_PAIR) && (v2.type == T_CLIST))
155 157
    return int_set_contains(v2.val.ad, v1.val.i);
158
  if ((v1.type == T_STRING) && (v2.type == T_STRING))
159
    return patmatch(v2.val.s, v1.val.s);
156 160

  
157 161
  if ((v1.type == T_IP) && (v2.type == T_PREFIX))
158 162
    return !(ipa_compare(ipa_and(v2.val.px.ip, ipa_mkmask(v2.val.px.len)), ipa_and(v1.val.px.ip, ipa_mkmask(v2.val.px.len))));
......
497 501
      case T_ENUM:
498 502
	res.val.i = * ((char *) rta + what->a2.i);
499 503
	break;
504
      case T_STRING:	/* Warning: this is a special case for proto attribute */
505
	res.val.s = rta->proto->name;
506
	break;
500 507
      case T_PREFIX:	/* Warning: this works only for prefix of network */
501 508
	{
502 509
	  res.val.px.ip = (*f_rte)->net->n.prefix;

Also available in: Unified diff