6in4: use localmask instead of hardcoded /128 when adding address to interface

This commit is contained in:
cinap_lenrek 2012-12-21 19:18:47 +01:00
parent 2c1c1e4005
commit 44ac7fe940

View file

@ -191,7 +191,7 @@ setup(int *v6net, int *tunp)
if (*v6net < 0 || fprint(cfd, "bind pkt") < 0) if (*v6net < 0 || fprint(cfd, "bind pkt") < 0)
sysfatal("can't bind packet interface: %r"); sysfatal("can't bind packet interface: %r");
/* 1280 is MTU, apparently from rfc2460 */ /* 1280 is MTU, apparently from rfc2460 */
if (fprint(cfd, "add %I /128 %I 1280", local6, remote6) <= 0) if (fprint(cfd, "add %I %M %I 1280", local6, localmask, remote6) <= 0)
sysfatal("can't set local ipv6 address: %r"); sysfatal("can't set local ipv6 address: %r");
close(cfd); close(cfd);
if (debug) if (debug)