Skip to content

Commit

Permalink
Merge pull request torvalds#435 from libos-nuse/fix-ip6-gw-handle
Browse files Browse the repository at this point in the history
lkl-upstream: fix ifgateway6 parameter handling
  • Loading branch information
thehajime authored Jun 12, 2018
2 parents 3feb0a7 + e8654e6 commit f74e30f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tools/lkl/lib/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,11 +597,11 @@ static int iproute_modify(int cmd, unsigned int flags, int ifindex, int af,
int rmbit = route_masklen%8;

for (i = 0; i < rmbyte; i++)
netaddr.in6_u.u6_addr8[16-i] = 0;
netaddr.in6_u.u6_addr8[16-rmbyte] =
(netaddr.in6_u.u6_addr8[16-rmbyte] >> rmbit);
netaddr.in6_u.u6_addr8[16-rmbyte] =
(netaddr.in6_u.u6_addr8[16-rmbyte] << rmbit);
netaddr.in6_u.u6_addr8[15-i] = 0;
netaddr.in6_u.u6_addr8[15-rmbyte] =
(netaddr.in6_u.u6_addr8[15-rmbyte] >> rmbit);
netaddr.in6_u.u6_addr8[15-rmbyte] =
(netaddr.in6_u.u6_addr8[15-rmbyte] << rmbit);
*(struct lkl_in6_addr *)route_addr = netaddr;
req.r.rtm_dst_len = route_masklen;
addattr_l(&req.n, sizeof(req), LKL_RTA_DST,
Expand Down

0 comments on commit f74e30f

Please sign in to comment.