Revision 662a3ab9 src/psinstance.c

View differences:

src/psinstance.c
53 53
	suseconds_t chunk_time_interval; // microseconds
54 54
	suseconds_t chunk_offer_interval; // microseconds
55 55
	int source_multiplicity;
56
	enum L3PROTOCOL l3;
56 57
};
57 58

  
58 59
int config_parse(struct psinstance * ps,const char * config)
......
68 69
	grapes_config_value_int_default(tags, "outbuff_size", &(ps->outbuff_size), 75);
69 70
	grapes_config_value_int_default(tags, "chunkbuffer_size", &(ps->chunkbuffer_size), 50);
70 71
	grapes_config_value_int_default(tags, "source_multiplicity", &(ps->source_multiplicity), 3);
72

  
71 73
	tmp_str = grapes_config_value_str_default(tags, "filename", NULL);
72 74
	strcpy((ps->inc).filename, tmp_str ? tmp_str : "");
75
	tmp_str = grapes_config_value_str_default(tags, "AF", NULL);
76
	ps->l3 = tmp_str && (strcmp(tmp_str, "INET6") == 0) ? IP6 : IP4;
73 77

  
74 78
	free(tags);
75 79
	return 0;
......
80 84
	char * my_addr;
81 85

  
82 86
	if (ps->iface)
83
		my_addr = iface_addr(ps->iface);
87
		my_addr = iface_addr(ps->iface, ps->l3);
84 88
	else
85
		my_addr = default_ip_addr();
89
		my_addr = default_ip_addr(ps->l3);
86 90
	if (my_addr == NULL)
87 91
	{
88 92
		fprintf(stderr, "[ERROR] cannot get a valid ip address\n");

Also available in: Unified diff