diff options
author | 2009-06-05 00:05:21 +0000 | |
---|---|---|
committer | 2009-06-05 00:05:21 +0000 | |
commit | 22760f565a521eee1242a6b1041c186acc77d298 (patch) | |
tree | cf09757382c6a5172e7749b5e2348595c70d6bc3 /sys/netinet6 | |
parent | Make imsg completely async model agnostic by not requiring an (diff) | |
download | wireguard-openbsd-22760f565a521eee1242a6b1041c186acc77d298.tar.xz wireguard-openbsd-22760f565a521eee1242a6b1041c186acc77d298.zip |
Initial support for routing domains. This allows to bind interfaces to
alternate routing table and separate them from other interfaces in distinct
routing tables. The same network can now be used in any doamin at the same
time without causing conflicts.
This diff is mostly mechanical and adds the necessary rdomain checks accross
net and netinet. L2 and IPv4 are mostly covered still missing pf and IPv6.
input and tested by jsg@, phessler@ and reyk@. "put it in" deraadt@
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/icmp6.c | 6 | ||||
-rw-r--r-- | sys/netinet6/in6_pcb.c | 14 | ||||
-rw-r--r-- | sys/netinet6/raw_ip6.c | 5 |
3 files changed, 13 insertions, 12 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index 67e3904a4f7..7453fe1e7b0 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: icmp6.c,v 1.104 2009/02/22 17:43:20 claudio Exp $ */ +/* $OpenBSD: icmp6.c,v 1.105 2009/06/05 00:05:22 claudio Exp $ */ /* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */ /* @@ -1217,7 +1217,7 @@ ni6_input(struct mbuf *m, int off) sin6.sin6_len = sizeof(struct sockaddr_in6); bcopy(&ip6->ip6_dst, &sin6.sin6_addr, sizeof(sin6.sin6_addr)); /* XXX scopeid */ - if (ifa_ifwithaddr((struct sockaddr *)&sin6)) + if (ifa_ifwithaddr((struct sockaddr *)&sin6, /* XXX */ 0)) ; /* unicast/anycast, fine */ else if (IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr)) ; /* link-local multicast, fine */ @@ -2336,7 +2336,7 @@ icmp6_redirect_input(struct mbuf *m, int off) rtredirect((struct sockaddr *)&sdst, (struct sockaddr *)&sgw, (struct sockaddr *)NULL, RTF_GATEWAY | RTF_HOST, (struct sockaddr *)&ssrc, - &newrt); + &newrt, /* XXX */ 0); if (newrt) { (void)rt_timer_add(newrt, icmp6_redirect_timeout, diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index a008f565912..a5f4f9502f7 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_pcb.c,v 1.48 2008/11/23 13:30:59 claudio Exp $ */ +/* $OpenBSD: in6_pcb.c,v 1.49 2009/06/05 00:05:22 claudio Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -235,8 +235,8 @@ in6_pcbbind(struct inpcb *inp, struct mbuf *nam, struct proc *p) */ sin6->sin6_flowinfo = 0; if (!(so->so_options & SO_BINDANY) && - ((ia = ifa_ifwithaddr((struct sockaddr *)sin6)) - == NULL)) + (ia = ifa_ifwithaddr((struct sockaddr *)sin6, + /* XXX */ 0)) == NULL) return EADDRNOTAVAIL; /* @@ -276,7 +276,7 @@ in6_pcbbind(struct inpcb *inp, struct mbuf *nam, struct proc *p) t = in_pcblookup(head, (struct in_addr *)&zeroin6_addr, 0, (struct in_addr *)&sin6->sin6_addr, lport, - wild); + wild, /* XXX */ 0); if (t && (reuseport & t->inp_socket->so_options) == 0) return EADDRINUSE; @@ -353,7 +353,7 @@ in6_pcbsetport(struct in6_addr *laddr, struct inpcb *inp, struct proc *p) lport = htons(*lastport); } while (in_baddynamic(*lastport, so->so_proto->pr_protocol) || in_pcblookup(table, &zeroin6_addr, 0, - &inp->inp_laddr6, lport, wild)); + &inp->inp_laddr6, lport, wild, /* XXX */ 0)); } else { /* * counting up @@ -371,7 +371,7 @@ in6_pcbsetport(struct in6_addr *laddr, struct inpcb *inp, struct proc *p) lport = htons(*lastport); } while (in_baddynamic(*lastport, so->so_proto->pr_protocol) || in_pcblookup(table, &zeroin6_addr, 0, - &inp->inp_laddr6, lport, wild)); + &inp->inp_laddr6, lport, wild, /* XXX */ 0)); } inp->inp_lport = lport; @@ -452,7 +452,7 @@ in6_pcbconnect(struct inpcb *inp, struct mbuf *nam) if (in_pcblookup(inp->inp_table, &sin6->sin6_addr, sin6->sin6_port, IN6_IS_ADDR_UNSPECIFIED(&inp->inp_laddr6) ? in6a : &inp->inp_laddr6, - inp->inp_lport, INPLOOKUP_IPV6)) { + inp->inp_lport, INPLOOKUP_IPV6, /* XXX */ 0)) { return (EADDRINUSE); } if (IN6_IS_ADDR_UNSPECIFIED(&inp->inp_laddr6)) { diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index 94ebaee050e..ec91971dd13 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raw_ip6.c,v 1.38 2008/11/23 13:30:59 claudio Exp $ */ +/* $OpenBSD: raw_ip6.c,v 1.39 2009/06/05 00:05:22 claudio Exp $ */ /* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */ /* @@ -673,7 +673,8 @@ rip6_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, * this in a more natural way. */ if (!IN6_IS_ADDR_UNSPECIFIED(&addr->sin6_addr) && - (ia = ifa_ifwithaddr((struct sockaddr *)addr)) == 0) { + (ia = ifa_ifwithaddr((struct sockaddr *)addr, + /* XXX */ 0)) == 0) { error = EADDRNOTAVAIL; break; } |