Commit 4fce191d authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Add argument newmetric to kernel_route.

parent 150a87a6
......@@ -546,7 +546,8 @@ kernel_interface_wireless(const char *ifname, int ifindex)
int
kernel_route(int operation, const unsigned char *dest, unsigned short plen,
const unsigned char *gate, int ifindex, unsigned int metric)
const unsigned char *gate, int ifindex,
unsigned int metric, unsigned int newmetric)
{
union { char raw[1024]; struct nlmsghdr nh; } buf;
......
......@@ -38,6 +38,7 @@ int kernel_setup_interface(int setup, const char *ifname, int ifindex);
int kernel_interface_mtu(const char *ifname, int ifindex);
int kernel_interface_wireless(const char *ifname, int ifindex);
int kernel_route(int operation, const unsigned char *dest, unsigned short plen,
const unsigned char *gate, int ifindex, unsigned int metric);
const unsigned char *gate, int ifindex,
unsigned int metric, unsigned int newmetric);
int kernel_routes(int maxplen, struct kernel_route *routes, int maxroutes);
int kernel_callback(void);
......@@ -180,7 +180,7 @@ install_route(struct route *route)
rc = kernel_route(ROUTE_ADD, route->dest->address, 128,
route->nexthop->address,
route->nexthop->network->ifindex,
metric_to_kernel(route->metric));
metric_to_kernel(route->metric), 0);
if(rc < 0) {
perror("kernel_route(ADD)");
if(errno != EEXIST)
......@@ -212,7 +212,7 @@ uninstall_route(struct route *route)
rc = kernel_route(ROUTE_FLUSH, route->dest->address, 128,
route->nexthop->address,
route->nexthop->network->ifindex,
metric_to_kernel(route->metric));
metric_to_kernel(route->metric), 0);
if(rc < 0)
perror("kernel_route(FLUSH)");
route->installed = 0;
......
......@@ -119,7 +119,7 @@ install_xroute(struct xroute *xroute)
rc = kernel_route(ROUTE_ADD, xroute->prefix, xroute->plen,
gwroute->nexthop->address,
gwroute->nexthop->network->ifindex,
metric_to_kernel(xroute->metric));
metric_to_kernel(xroute->metric), 0);
if(rc < 0) {
perror("kernel_route(ADD)");
if(errno != EEXIST)
......@@ -148,7 +148,7 @@ uninstall_xroute(struct xroute *xroute)
rc = kernel_route(ROUTE_FLUSH, xroute->prefix, xroute->plen,
gwroute->nexthop->address,
gwroute->nexthop->network->ifindex,
metric_to_kernel(xroute->metric));
metric_to_kernel(xroute->metric), 0);
if(rc < 0)
perror("kernel_route(FLUSH)");
xroute->installed = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment