Commit Graph

1381 Commits

Author SHA1 Message Date
ozaki-r
eefc30d59b Pull out ipsec routines from ip6_input
This change reduces symbol references from netinet6 to netipsec
and improves modularity of netipsec.

No functional change is intended.
2015-04-01 02:49:44 +00:00
ozaki-r
f35c2148c2 Tidy up opt_ipsec.h inclusions 2015-03-30 04:25:26 +00:00
ozaki-r
32be705817 Include ip6.h for ip6_hdr 2015-03-30 02:23:21 +00:00
roy
a37502b2b6 Add RTF_BROADCAST to mark routes used for the broadcast address when
they are created on the fly. This makes it clear what the route is for
and allows an optimisation in ip_output() by avoiding a call to
in_broadcast() because most of the time we do talk to a host.
It also avoids a needless allocation for the storage of llinfo_arp and
thus vanishes from arp(8) - it showed as incomplete anyway so this
is a nice side effect.

Guard against this and routes marked with RTF_BLACKHOLE in
ip_fastforward().
While here, guard against routes marked with RTF_BLACKHOLE in
ip6_fastforward().
RTF_BROADCAST is IPv4 only, so don't bother checking that here.
2015-03-23 18:33:17 +00:00
roy
5170946304 Don't add local routes for the any address or p2p addresses where the address matches the destination. 2015-02-26 12:58:36 +00:00
roy
42900924fd Introduce the routing flag RTF_LOCAL to track local address routes.
Add functions rt_ifa_addlocal() and rt_ifa_remlocal() to add and remove
local routes for the address and announce the new address and route
to the routing socket.

Add in_ifaddlocal() and in_ifremlocal() to use these functions.
Rename in6_if{add,rem}loop() to in6_if{add,rem}local() and use these
functions.

rtinit() no longer announces the address, just the network route for the
address. As such, calls to rt_newaddrmsg() have been removed from
in_addprefix() and in_scrubprefix().

This solves the problem of potentially more than one announcement, or no
announcement at all for the address in certain situations.
2015-02-26 09:54:46 +00:00
roy
1d0df6e404 Rename nd6_rtmsg() to rt_newmsg() and move into the generic routing code
as it's not IPv6 specific and will be used elsewhere.
2015-02-25 12:45:34 +00:00
roy
1777c2ee4b Retire nd6_newaddrmsg and use rt_newaddrmsg directly instead so that
we don't spam route changes when the route hasn't changed.
2015-02-25 00:26:58 +00:00
martin
94a27aa4e3 Rearange interface detachement slightly: before we free the INET6 specific
per-interface data, make sure to call nd6_purge() with it to remove
routing entries pointing to the going interface.
When we should happen to call this function again later, with the data
already gone, just return.
Fixes PR kern/49682, ok: christos.
2015-02-23 19:15:59 +00:00
rjs
3e6de5e8d2 Declare input argument to in6_sin_2_v4mapsin6 to be const, allows an
address from the route cache to be used as the input.

ok christos@.
2015-02-20 22:13:48 +00:00
christos
c4bbd62988 "something odd happens" is not a useful error message. 2015-02-17 15:14:28 +00:00
rjs
652788239c Add DCCP protocol support from KAME. 2015-02-10 19:11:52 +00:00
christos
0090b13dae CID/1267860: Missing break in switch 2015-02-02 03:14:02 +00:00
roy
a3c36dcba4 Fix IPV6_USE_MIN_MTU set by setsockopt(2) being ignored when
IPV6_PKTINFO is set as a control with sendmsg(2).
2015-01-20 21:42:36 +00:00
roy
9daa8a6db0 Add net.inet6.ip6.prefer_tempaddr sysctl knob so that we can prefer
IPv6 temporary addresses as the source address.

Fixes PR kern/47100 based on a patch by Dieter Roelants.
2015-01-20 21:27:36 +00:00
roy
24c1397228 Report route additions/changes/deletions for cached neighbours to userland. 2014-12-16 11:42:27 +00:00
christos
d1456ccc1f printable version of the scope.
remove stray breaks.
2014-12-10 01:10:37 +00:00
christos
e0b4678125 call vsnprintf instead of snprintf; provide more detail 2014-12-10 01:10:14 +00:00
christos
cb7e0235f1 Merge some common code in the failed forwarding case, while providing better
diagnostics, and fixing leaks.
2014-12-08 00:19:37 +00:00
seanb
1f56ae1036 - Fix comment which was no longer accurate after previous change to move
from in_pcbconnect -> in6_pcbsetport.
2014-12-05 18:45:37 +00:00
christos
99c363a8a2 more debugging info... 2014-12-03 01:32:11 +00:00
christos
f89df58b37 use the new printing code. 2014-12-02 20:25:47 +00:00
christos
a5009781c6 add routines to print in6_addr and sockaddr_in6 (in6_print, sin6_print) 2014-12-02 19:36:58 +00:00
christos
52b8bb1b69 CID 977389: Out of bounds access. 2014-11-25 19:51:17 +00:00
seanb
ae36e3e5b1 Really make SO_REUSEPORT and SO_REUSEADDR equivalent for multicast
sockets.  From FreeBSD.
2014-11-25 19:09:13 +00:00
seanb
56c6664a5c Clean up any dangling ifp references in (struct in6pcb *)->in6p_v4moptions
(v4 multicast options off v4 mapped v6 socket) on interface destruction.  The
code to clean this up in a true v4 socket was moved to its own function
which is now also called in the corresponding place for v6 sockets on
interface destruction.
2014-11-25 15:04:37 +00:00
joerg
1a64665727 Drop impossible check. 2014-11-16 00:04:06 +00:00
maxv
833172a8e0 Do not uselessly include <sys/malloc.h>. 2014-11-14 17:34:23 +00:00
ozaki-r
d5cdd84d0a Ensure callout isn't running and pending before callout_destroy
Call callout_halt before callout_destroy. And also let callout (mld_timeo)
not call callout_schedule when we already called callout_halt.

This fixes PR 47881.
2014-11-12 03:24:25 +00:00
roy
23e96eacf2 Clear IN6_IFF_DUPLICATED when link goes down or up. 2014-11-03 13:04:12 +00:00
christos
192050492a print mapped addresses better 2014-10-27 14:10:12 +00:00
roy
38d2e3f021 Remove the ability for userland to toggle IN6_IFF_TENTATIVE.
Preserve IN6_IFF_TENTATIVE when updating address flags.
2014-10-20 14:50:09 +00:00
snj
f0a7346d21 src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
2014-10-18 08:33:23 +00:00
roy
15d73271e1 Tests for neighbour now work correctly on bridge(4) and carp(4) interfaces. 2014-10-14 15:29:43 +00:00
roy
1b519b6d17 Remove redundant logging. 2014-10-12 20:05:50 +00:00
christos
01fcb35dc2 document that we depend on the option numbers matching. 2014-10-12 19:02:18 +00:00
christos
4f85a755f8 Refactor the multicast membership code so that we can handle v4 mapped
addresses using the v6 membership ioctls.
2014-10-12 19:00:21 +00:00
christos
48e7af1441 Succeed binding to multicast address for now: Open questions:
Open questions:

    http://mail-index.netbsd.org/tech-net/2014/07/23/msg004714.html
2014-10-11 23:07:39 +00:00
christos
f26c7dc958 Make IPV4 mapped addresses able to do IPV4 multicast. Fixes needed:
- allow binding to mapped v4 multicast addresses
	- define v4moptions, allow setting it via ioctl, pass it to ip_output,
	  free it when killing the pcb.

Ideally we would allow the IPV6 multicast setsockopts work on mapped addresses
too, but this is a lot more work and linux does not do it either.
2014-10-11 20:53:16 +00:00
rmind
436f757159 Eliminate IFAREF() and IFAFREE() macros in favour of functions. 2014-09-09 20:16:12 +00:00
rmind
2082db2d3c in_pcbdetach: move ip_freemoptions() under softnet_lock for now (this will
be changed back once other IP paths become MP-safe).  Same for IPv6 routine.

This partially reverts 1.150 of in_pcb.c and 1.127 of in6_pcb.c changes.
2014-09-07 00:50:56 +00:00
matt
6f1589d59d Don't use C++ keyword as variable.
Use different prefix for nd6_prefixctl members than for nd6_prefix members.
2014-09-05 06:08:15 +00:00
matt
a9081927c7 Don't nest structure definitions. 2014-09-05 06:06:31 +00:00
matt
62dd88055e Don't use new as a variable name. 2014-09-05 05:33:06 +00:00
maxv
b6cc446ce5 http://m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html#Report-2
#03-0x02: Memory leak

ok ozaki-r@
2014-08-16 17:27:09 +00:00
rtr
8cf67cc6d5 split PRU_CONNECT2 & PRU_PURGEIF function out of pr_generic() usrreq
switches and put into separate functions

  - always KASSERT(solocked(so)) even if not implemented
    (for PRU_CONNECT2 only)

  - replace calls to pr_generic() with req = PRU_CONNECT2 with calls to
    pr_connect2()

  - replace calls to pr_generic() with req = PRU_PURGEIF with calls to
    pr_purgeif()

put common code from unp_connect2() (used by unp_connect() into
unp_connect1() and call out to it when needed

patch only briefly reviewed by rmind@
2014-08-09 05:33:00 +00:00
rtr
822872eada split PRU_RCVD function out of pr_generic() usrreq switches and put into
separate functions

  - always KASSERT(solocked(so)) even if not implemented

  - replace calls to pr_generic() with req = PRU_RCVD with calls to
    pr_rcvd()
2014-08-08 03:05:44 +00:00
rtr
651e5bd3f8 split PRU_SEND function out of pr_generic() usrreq switches and put into
separate functions

   xxx_send(struct socket *, struct mbuf *, struct mbuf *,
       struct mbuf *, struct lwp *)

  - always KASSERT(solocked(so)) even if not implemented

  - replace calls to pr_generic() with req = PRU_SEND with calls to
    pr_send()

rename existing functions that operate on PCB for consistency (and to
free up their names for xxx_send() PRUs

  - l2cap_send() -> l2cap_send_pcb()
  - sco_send() -> sco_send_pcb()
  - rfcomm_send() -> rfcomm_send_pcb()

patch reviewed by rmind
2014-08-05 07:55:31 +00:00
rtr
ce6a5ff64f revert the removal of struct lwp * parameter from bind, listen and connect
user requests.

this should resolve the issue relating to nfs client hangs presented
recently by wiz on current-users@
2014-08-05 05:24:26 +00:00
rmind
73e4b5c06b in6_pcbdetach: now that IGMP and multicast groups are MP-safe, we can move
the ip6_freemoptions() call outside the softnet_lock.  Should fix PR/49065.
2014-08-03 22:55:24 +00:00