int rv = 0;
lb_vip_add_args_t args;
- if((mp->protocol != IP_PROTOCOL_TCP)
- && (mp->protocol != IP_PROTOCOL_UDP))
+ /* if port == 0, it means all-port VIP */
+ if (mp->port == 0)
{
mp->protocol = ~0;
- mp->port = 0;
}
memcpy (&(args.prefix.ip6), mp->ip_prefix, sizeof(args.prefix.ip6));
if (mp->is_del) {
u32 vip_index;
if (!(rv = lb_vip_find_index(&(args.prefix), mp->prefix_length,
- mp->protocol, mp->port, &vip_index)))
+ mp->protocol, ntohs(mp->port), &vip_index)))
rv = lb_vip_del(vip_index);
} else {
u32 vip_index;
}
args.plen = mp->prefix_length;
+ args.protocol = mp->protocol;
+ args.port = ntohs(mp->port);
args.type = type;
args.new_length = ntohl(mp->new_flows_table_length);
sizeof(as_address.ip6));
if ((rv = lb_vip_find_index(&vip_ip_prefix, mp->vip_prefix_length,
- mp->protocol, mp->port, &vip_index)))
+ mp->protocol, ntohs(mp->port), &vip_index)))
goto done;
if (mp->is_del)
vip_plen = mp->prefix_length;
rv = lb_vip_find_index(&vip_prefix, vip_plen, mp->protocol,
- (u16)mp->port, &vip_index);
+ ntohs(mp->port), &vip_index);
rv = lb_flush_vip_as(vip_index, ~0);