sync with OpenBSD -current
This commit is contained in:
parent
2d0895064a
commit
0d235ae71d
70 changed files with 1715 additions and 502 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: in6.c,v 1.266 2024/05/21 15:12:25 florian Exp $ */
|
||||
/* $OpenBSD: in6.c,v 1.267 2024/06/07 09:48:19 florian Exp $ */
|
||||
/* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -549,7 +549,7 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
|
|||
struct in6_ifaddr *ia6)
|
||||
{
|
||||
int error = 0, hostIsNew = 0, plen = -1;
|
||||
struct sockaddr_in6 dst6;
|
||||
struct sockaddr_in6 dst6, gw6;
|
||||
struct in6_addrlifetime *lt;
|
||||
struct in6_multi_mship *imm;
|
||||
struct rtentry *rt;
|
||||
|
@ -604,7 +604,13 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
|
|||
plen = in6_mask2len(&ia6->ia_prefixmask.sin6_addr, NULL);
|
||||
}
|
||||
|
||||
dst6 = ifra->ifra_dstaddr;
|
||||
if (ifra->ifra_flags & IN6_IFF_AUTOCONF) {
|
||||
gw6 = ifra->ifra_dstaddr;
|
||||
memset(&dst6, 0, sizeof(dst6));
|
||||
} else {
|
||||
dst6 = ifra->ifra_dstaddr;
|
||||
memset(&gw6, 0, sizeof(gw6));
|
||||
}
|
||||
if (dst6.sin6_family == AF_INET6) {
|
||||
error = in6_check_embed_scope(&dst6, ifp->if_index);
|
||||
if (error)
|
||||
|
@ -614,6 +620,11 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
|
|||
(ifp->if_flags & IFF_LOOPBACK)) && plen != 128)
|
||||
return (EINVAL);
|
||||
}
|
||||
if (gw6.sin6_family == AF_INET6) {
|
||||
error = in6_check_embed_scope(&gw6, ifp->if_index);
|
||||
if (error)
|
||||
return error;
|
||||
}
|
||||
/* lifetime consistency check */
|
||||
lt = &ifra->ifra_lifetime;
|
||||
if (lt->ia6t_pltime > lt->ia6t_vltime)
|
||||
|
@ -702,10 +713,10 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra,
|
|||
}
|
||||
|
||||
if ((ifra->ifra_flags & IN6_IFF_AUTOCONF) &&
|
||||
dst6.sin6_family == AF_INET6 &&
|
||||
gw6.sin6_family == AF_INET6 &&
|
||||
!IN6_ARE_ADDR_EQUAL(&dst6.sin6_addr, &ia6->ia_gwaddr.sin6_addr)) {
|
||||
/* Set or update announcing router */
|
||||
ia6->ia_gwaddr = dst6;
|
||||
ia6->ia_gwaddr = gw6;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ip6_forward.c,v 1.117 2024/04/16 12:56:39 bluhm Exp $ */
|
||||
/* $OpenBSD: ip6_forward.c,v 1.118 2024/06/07 18:24:16 bluhm Exp $ */
|
||||
/* $KAME: ip6_forward.c,v 1.75 2001/06/29 12:42:13 jinmei Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -75,7 +75,7 @@
|
|||
* of codes and types.
|
||||
*
|
||||
* If not forwarding, just drop the packet. This could be confusing
|
||||
* if ipforwarding was zero but some routing protocol was advancing
|
||||
* if ip6_forwarding was zero but some routing protocol was advancing
|
||||
* us as a gateway to somewhere. However, we must let the routing
|
||||
* protocol deal with that.
|
||||
*
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ip6_mroute.c,v 1.141 2024/04/06 14:23:27 bluhm Exp $ */
|
||||
/* $OpenBSD: ip6_mroute.c,v 1.142 2024/06/07 08:37:59 jsg Exp $ */
|
||||
/* $NetBSD: ip6_mroute.c,v 1.59 2003/12/10 09:28:38 itojun Exp $ */
|
||||
/* $KAME: ip6_mroute.c,v 1.45 2001/03/25 08:38:51 itojun Exp $ */
|
||||
|
||||
|
@ -135,34 +135,6 @@ int ip6_mrouter_ver = 0;
|
|||
int ip6_mrtproto; /* for netstat only */
|
||||
struct mrt6stat mrt6stat;
|
||||
|
||||
#define NO_RTE_FOUND 0x1
|
||||
#define RTE_FOUND 0x2
|
||||
|
||||
/*
|
||||
* Macros to compute elapsed time efficiently
|
||||
* Borrowed from Van Jacobson's scheduling code
|
||||
*/
|
||||
#define TV_DELTA(a, b, delta) do { \
|
||||
int xxs; \
|
||||
\
|
||||
delta = (a).tv_usec - (b).tv_usec; \
|
||||
if ((xxs = (a).tv_sec - (b).tv_sec)) { \
|
||||
switch (xxs) { \
|
||||
case 2: \
|
||||
delta += 1000000; \
|
||||
/* FALLTHROUGH */ \
|
||||
case 1: \
|
||||
delta += 1000000; \
|
||||
break; \
|
||||
default: \
|
||||
delta += (1000000 * xxs); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define TV_LT(a, b) (((a).tv_usec < (b).tv_usec && \
|
||||
(a).tv_sec <= (b).tv_sec) || (a).tv_sec < (b).tv_sec)
|
||||
|
||||
int get_sg6_cnt(struct sioc_sg_req6 *, unsigned int);
|
||||
int get_mif6_cnt(struct sioc_mif_req6 *, unsigned int);
|
||||
int ip6_mrouter_init(struct socket *, int, int);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue