Commit Graph

1397 Commits

Author SHA1 Message Date
rtr fd12cf39ee make connect syscall use sockaddr_big and modify pr_{send,connect}
nam parameter type from buf * to sockaddr *.

final commit for parameter type changes to protocol user requests

* bump kernel version to 7.99.15 for parameter type changes to pr_{send,connect}
2015-05-02 17:18:03 +00:00
roy 9cdef53c9c Mitigate Local Denial of Service with IPv6 Router Advertisements and
log attack attempts.

Fixes CVE-2015-2923, taken from FreeBSD.
2015-05-02 14:28:30 +00:00
ozaki-r 36d424c9ec Don't take KERNEL_LOCK for if_output when NET_MPSAFE 2015-04-30 10:00:04 +00:00
ozaki-r 5f21075b8f Add missing error checks on rtcache_setdst
It can fail with ENOMEM.
2015-04-27 10:14:44 +00:00
ozaki-r 2373b55abc Introduce in6_selecthlim_rt to consolidate an idiom for rt->rt_ifp
It consolidates a scattered routine:
(rt = rtcache_validate(&in6p->in6p_route)) != NULL ? rt->rt_ifp : NULL
2015-04-27 02:59:44 +00:00
rtr d2aa9dd71f remove pr_generic from struct pr_usrreqs and all implementations of
pr_generic in protocols.

bump to 7.99.13

approved by rmind@
2015-04-26 21:40:48 +00:00
rtr 89539c0d5f return EINVAL if sin{,6}_len != sizeof(sockaddr_in{,6}) respectively in
in{,6}_pcbconnect().

checking just m->m_len isn't enough because there are various places that
assume sa_len has been properly populated.
2015-04-26 16:45:50 +00:00
rtr 403dacccdb fix missed parameter type change in dccp6_accept() to sockaddr * from mbuf * 2015-04-25 14:56:05 +00:00
rtr eddf3af3c6 make accept, getsockname and getpeername syscalls use sockaddr_big and modify
pr_{accept,sockname,peername} nam parameter type from mbuf * to sockaddr *.

* retained use of mbuftypes[MT_SONAME] for now.
* bump to netbsd version 7.99.12 for parameter type change.

patch posted to tech-net@ 2015/04/19
2015-04-24 22:32:37 +00:00
ozaki-r 2c22236376 Avoid NULL checks for a variable that is definitely NULL 2015-04-24 08:53:06 +00:00
ozaki-r 7600c4ec42 Add missing rtcache_free
It's the same as other similar code paths in in_gif and ip6_etherip.
2015-04-24 07:51:43 +00:00
roy b1f5fd8a7f Move INET6 specific in6_if_{up,down}() and in6_if_link_{up,down}()
into agnostic domain functions.
2015-04-22 19:46:08 +00:00
roy 33e035dca4 Introduce p2p_rtrequest() so that IFF_POINTOPOINT interfaces can work
with RTF_LOCAL.
Fixes PR kern/49829.
2015-04-20 10:19:54 +00:00
roy 2aa9f440e3 Move in6if_do_dad() to if_do_dad() as the routine is not INET6 specific
and could equally be used by INET.
2015-04-07 23:30:36 +00:00
rtr 80ea8ccc7c * update dccp_bind for struct mbuf * to struct sockaddr * parameter change
* pass NULL instead of casting 0 to a pointer when calling in_pcbbind()
2015-04-04 04:33:38 +00:00
rtr a2ba5e69ab * change pr_bind to accept struct sockaddr * instead of struct mbuf *
* update protocol bind implementations to use/expect sockaddr *
  instead of mbuf *
* introduce sockaddr_big struct for storage of addr data passed via
  sys_bind; sockaddr_big is of sufficient size and alignment to
  accommodate all addr data sizes received.
* modify sys_bind to allocate sockaddr_big instead of using an mbuf.
* bump kernel version to 7.99.9 for change to pr_bind() parameter type.

Patch posted to tech-net@
  http://mail-index.netbsd.org/tech-net/2015/03/15/msg005004.html

The choice to use a new structure sockaddr_big has been retained since
changing sockaddr_storage size would lead to unnecessary ABI change. The
use of the new structure does not preclude future work that increases
the size of sockaddr_storage and at that time sockaddr_big may be
trivially replaced.

Tested by mrg@ and myself, discussed with rmind@, posted to tech-net@
2015-04-03 20:01:07 +00:00
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