Skip to content

Commit

Permalink
Handle split includes
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jan 26, 2015
1 parent 79042d6 commit ee445d9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions oncp.c
Expand Up @@ -739,6 +739,27 @@ static int process_attr(struct openconnect_info *vpninfo, int group, int attr,
add_option(vpninfo, "ipaddr", buf, -1);
break;

case GRP_ATTR(3, 3): {
struct oc_split_include *inc;
if (attrlen != 8)
goto badlen;
snprintf(buf, sizeof(buf), "%d.%d.%d.%d/%d.%d.%d.%d",
data[0], data[1], data[2], data[3],
data[4], data[5], data[6], data[7]);
vpn_progress(vpninfo, PRG_DEBUG, _("Received split include route %s\n"), buf);
if (!data[4] && !data[5] && !data[6] && !data[7])
break;
inc = malloc(sizeof(*inc));
if (inc) {
inc->route = add_option(vpninfo, "split-include", buf, -1);
if (inc->route) {
inc->next = vpninfo->ip_info.split_includes;
vpninfo->ip_info.split_includes = inc;
} else
free(inc);
}
break;
}
case GRP_ATTR(4, 1):
if (attrlen != 4)
goto badlen;
Expand Down

0 comments on commit ee445d9

Please sign in to comment.