Skip to content

Commit d472ae9

Browse files
committed
add note
1 parent 20bf52d commit d472ae9

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

uinet/example/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ void *ipv6_udp_client_test(void *arg)
10641064
void *tcp_web_test(void *arg)
10651065
{
10661066
int sockfd = rsp_socket(RSP_AF_INET, RSP_SOCK_STREAM, 0);
1067-
printf("tcp_web_test sockfd:%d\n", sockfd);
1067+
printf("\nstart web server\n");
10681068
if (sockfd < 0)
10691069
{
10701070
printf("rsp_socket failed\n");

uinet/lib/ff_config.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,13 @@ port_cfg_handler(struct ff_config *cfg, const char *section,
196196
return 0;
197197
}
198198

199-
cfg->portid_list = malloc(sizeof(uint16_t)*MAX_ETHPORTS);
199+
cfg->portid_list = malloc(sizeof(uint16_t)*MAX_ETHPORTS);
200200
if (cfg->portid_list == NULL) {
201201
fprintf(stderr, "parse_port_list malloc failed\n");
202202
return 0;
203203
}
204-
memset(cfg->portid_list,0,sizeof(uint16_t)*MAX_ETHPORTS);
205-
204+
memset(cfg->portid_list,0,sizeof(uint16_t)*MAX_ETHPORTS);
205+
206206
cfg->max_portid = cfg->portid_list[MAX_ETHPORTS-1];
207207
// initialize lcore list and nb_lcores
208208
int i;
@@ -215,7 +215,6 @@ port_cfg_handler(struct ff_config *cfg, const char *section,
215215
}
216216
cfg->port_cfgs = pc;
217217

218-
219218
}
220219

221220
int portid;
@@ -238,15 +237,18 @@ port_cfg_handler(struct ff_config *cfg, const char *section,
238237
}
239238

240239
if (strcmp(name, "addr") == 0) {
240+
printf("em0: ipaddr:%s\n",value);
241241
cur->addr = strdup(value);
242242
} else if (strcmp(name, "netmask") == 0) {
243+
printf("em0: netmask:%s\n",value);
243244
cur->netmask = strdup(value);
244245
} else if (strcmp(name, "broadcast") == 0) {
245246
cur->broadcast = strdup(value);
246247
} else if (strcmp(name, "gateway") == 0) {
248+
printf("em0: gateway:%s\n",value);
247249
cur->gateway = strdup(value);
248-
} else if (strcmp(name, "mac") == 0) {
249-
set_port_mac(cur->mac,value);
250+
} else if (strcmp(name, "mac") == 0) {
251+
set_port_mac(cur->mac,value);
250252
}
251253

252254
return 1;

0 commit comments

Comments
 (0)