- int fd, ret = para_connect_simple(IPPROTO_DCCP, conf->host_arg,
- conf->port_arg);
- if (ret < 0)
- return ret;
- fd = ret;
+ struct flowopts *fo = NULL;
+ uint8_t *ccids = NULL;
+ int fd, ret, i;
+
+ /* Copy CCID preference list (u8 array required) */
+ if (conf->ccid_given) {
+ ccids = para_malloc(conf->ccid_given);
+ fo = flowopt_new();
+
+ for (i = 0; i < conf->ccid_given; i++)
+ ccids[i] = conf->ccid_arg[i];
+
+ OPT_ADD(fo, SOL_DCCP, DCCP_SOCKOPT_CCID, ccids, i);
+ }
+
+ fd = makesock(IPPROTO_DCCP, 0, conf->host_arg, conf->port_arg, fo);
+ flowopt_cleanup(fo);
+ free(ccids);
+ if (fd < 0)
+ return fd;