MCPcopy Create free account
hub / github.com/F-Stack/f-stack / route_ip6_add

Function route_ip6_add

dpdk/app/graph/ip6_route.c:82–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82static int
83route_ip6_add(struct route_ipv6_config *route)
84{
85 struct route_ipv6_config *ipv6route;
86 int rc = -EINVAL;
87 int j;
88
89 ipv6route = find_route6_entry(route);
90 if (!ipv6route) {
91 ipv6route = malloc(sizeof(struct route_ipv6_config));
92 if (!ipv6route)
93 return -ENOMEM;
94 } else {
95 return 0;
96 }
97
98 for (j = 0; j < ETHDEV_IPV6_ADDR_LEN; j++) {
99 ipv6route->ip[j] = route->ip[j];
100 ipv6route->mask[j] = route->mask[j];
101 ipv6route->gateway[j] = route->gateway[j];
102 }
103 ipv6route->is_used = true;
104
105 if (!graph_status_get())
106 goto exit;
107
108 rc = route6_rewirte_table_update(ipv6route);
109 if (rc)
110 goto free;
111
112exit:
113 TAILQ_INSERT_TAIL(&route6, ipv6route, next);
114 return 0;
115free:
116 free(ipv6route);
117 return rc;
118}
119
120int
121route_ip6_add_to_lookup(void)

Callers 1

cli_ipv6_lookupFunction · 0.85

Calls 5

find_route6_entryFunction · 0.85
mallocFunction · 0.85
graph_status_getFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected