mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-03 09:00:21 +00:00
Set link-local address of tun interface with prefixlen = 64
instead of 128. It makes RA happy. Reported by: rafa@dif.um.es, SHIRASAKI Yasuhiro <yasuhiro@nttv6.jp> Reviewed by: SHIRASAKI Yasuhiro <yasuhiro@nttv6.jp> MFC after: 1 week
This commit is contained in:
parent
0e80a2f601
commit
977e6c08fe
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=113067
@ -83,6 +83,10 @@
|
||||
#include "prompt.h"
|
||||
#include "iface.h"
|
||||
|
||||
#define IN6MASK128 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }}}
|
||||
static const struct in6_addr in6mask128 = IN6MASK128;
|
||||
|
||||
|
||||
struct iface *
|
||||
iface_Create(const char *name)
|
||||
@ -333,7 +337,8 @@ iface_addr_Add(const char *name, struct iface_addr *addr, int s)
|
||||
memcpy(&ifra6.ifra_prefixmask, &ssmsk, sizeof ifra6.ifra_prefixmask);
|
||||
if (ncpaddr_family(&addr->peer) == AF_UNSPEC)
|
||||
ifra6.ifra_dstaddr.sin6_family = AF_UNSPEC;
|
||||
else
|
||||
else if (memcmp(&((struct sockaddr_in6 *)&ssmsk)->sin6_addr, &in6mask128,
|
||||
sizeof in6mask128) == 0)
|
||||
memcpy(&ifra6.ifra_dstaddr, &sspeer, sizeof ifra6.ifra_dstaddr);
|
||||
ifra6.ifra_lifetime.ia6t_vltime = ND6_INFINITE_LIFETIME;
|
||||
ifra6.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME;
|
||||
@ -426,7 +431,7 @@ int
|
||||
iface_Add(struct iface *iface, struct ncp *ncp, const struct ncprange *ifa,
|
||||
const struct ncpaddr *peer, int how)
|
||||
{
|
||||
int af, n, removed, s, width;
|
||||
int af, n, removed, s;
|
||||
struct ncpaddr ncplocal;
|
||||
struct iface_addr *addr, newaddr;
|
||||
|
||||
@ -452,11 +457,6 @@ iface_Add(struct iface *iface, struct ncp *ncp, const struct ncprange *ifa,
|
||||
return 1; /* Already there */
|
||||
}
|
||||
|
||||
width =
|
||||
#ifndef NOINET6
|
||||
(af == AF_INET6) ? 128 :
|
||||
#endif
|
||||
32;
|
||||
removed = iface_addr_Zap(iface->name, iface->addr + n, s);
|
||||
if (removed)
|
||||
ncp_IfaceAddrDeleted(ncp, iface->addr + n);
|
||||
|
@ -224,7 +224,7 @@ ipcp_SetIPv6address(struct ipv6cp *ipv6cp, u_char *myifid, u_char *hisifid)
|
||||
|
||||
ncpaddr_setip6(&ipv6cp->myaddr, &myaddr);
|
||||
ncpaddr_setip6(&ipv6cp->hisaddr, &hisaddr);
|
||||
ncprange_sethost(&myrange, &ipv6cp->myaddr);
|
||||
ncprange_set(&myrange, &ipv6cp->myaddr, 64);
|
||||
|
||||
if (!iface_Add(bundle->iface, &bundle->ncp, &myrange, &ipv6cp->hisaddr,
|
||||
IFACE_ADD_FIRST|IFACE_FORCE_ADD|IFACE_SYSTEM))
|
||||
|
Loading…
Reference in New Issue
Block a user