Age | Commit message (Collapse) | Author |
|
Based/previous work on an idea from deraadt@
Input from claudio@, djm@, deraadt@, sthen@
OK deraadt@
|
|
messages, and save the route flags before deleting the route. For L2
route entries, the RTF_LLINFO flag is cleared during deletion, so saving
the flags beforehand means they're correct in the routing socket message.
ok mpi@
|
|
Those are for the gateway sockaddrs which get allocated in rt_setgate()
with the same ROUNDUP(sa_len) approach.
mpi already added a sizes for a few rt_gateway sockaddrs in two commits,
these are the last one in route.c leaving only ifafree() behind.
OK mpi
|
|
time_second(9) and time_uptime(9) are widely used in the kernel to
quickly get the system UTC or system uptime as a time_t. However,
time_t is 64-bit everywhere, so it is not generally safe to use them
on 32-bit platforms: you have a split-read problem if your hardware
cannot perform atomic 64-bit reads.
This patch replaces time_second(9) with gettime(9), a safer successor
interface, throughout the kernel. Similarly, time_uptime(9) is replaced
with getuptime(9).
There is a performance cost on 32-bit platforms in exchange for
eliminating the split-read problem: instead of two register reads you
now have a lockless read loop to pull the values from the timehands.
This is really not *too* bad in the grand scheme of things, but
compared to what we were doing before it is several times slower.
There is no performance cost on 64-bit (__LP64__) platforms.
With input from visa@, dlg@, and tedu@.
Several bugs squashed by visa@.
ok kettenis@
|
|
ignored. Initialize 'error' to 0.
CID 1483380
ok mpi@
|
|
address as the one trying to be inserted.
Such entry must stay in the table as long as its parent route exist. If
a code path tries to re-insert a route with the same destination address
on the same interface it is a bug.
Avoid the "route contains no arp information" problem reported by sthen@
and Laurent Salle.
ok claudio@
|
|
|
|
each dereference. r1.275 added a check at the top of the function,
with an immediate "return (-1)" if src == NULL. Thus making the
repeated checks in the body superfluous.
CID 1452932.
ok millert@ mpi@
|
|
returning a (possibly uninitialized) value.
CID 1483466.
ok millert@
|
|
The routing labels have nothing todo with rdomains and routing tables.
Remove the unneeded rdomain check. With this rtlabel on interfaces work again.
OK kn@
|
|
address could trigger the "rt->rt_ifidx == ifp->if_index" assertion.
In rtflushclone() the ifp that is passed to rtdeletemsg() has been
changed from the route interface to the ifa interface. Restore the
old behavior and get the route ifp.
found by regress/sys/netinet/carp; OK mpi@
|
|
rtable_walk(9) now passes a routing entry back to the caller when
a non zero value is returned and if it asked for it.
This allows us to call rtdeletemsg()/rtrequest_delete() from the
caller without creating a recursion because of rtflushclone().
Multicast code hasn't been adapted and is still possibly creating
recursions. However multicast route entries aren't cloned so if
a recursion exists it isn't because of rtflushclone().
Fix stack exhaustion triggered by the use of "-msave-args".
Issue reported by Dániel Lévai on bugs@ confirmed by and ok bluhm@.
|
|
before adding it to the routing table. The rtable code is doing memcmp()
of those rt_dest sockaddrs so it is important that they are stored in a
canonical form. To do this struct domain is extended to include the
sockaddr size for this address family.
OK bluhm@ anton@
Reported-by: syzbot+10fe9cd8d0211c562ead@syzkaller.appspotmail.com
|
|
the RTF_MPLS can't be toggled without rt_mpls_set() being called. While
RTF_MPLS is part of RTF_FMASK it should be excluded from the flags and mask
when they are applied to the route since toggling it requires a call to
rt_mpls_set().
OK bluhm@
Reported-by: syzbot+86344a9e31c27aa6f15b@syzkaller.appspotmail.com
|
|
type,
and definately don't do this to the length: (unsigned)(cplim2 - cp2)
ok claudio
|
|
because the rtable_l2 is modified before calling rt_ifa_del.
Triggered by regress test and reported by Moritz Buhl mbuhl at mbuhl dot me
|
|
this allows mpls interfaces (mpe, mpw) to pass the rdomain they
wish the local label to be in, rather than have it implicitly forced
to 0 by these functions. right now they'll pass 0, but it will soon
be possible to have them rx packets in other rdomains.
previously the functions used ifp->if_rdomain for the rdomain.
everything other than mpls still passes ifp->if_rdomain.
ok mpi@
|
|
MPLS interfaces (ab)use rt_ifa_add for adding the local MPLS label
that they listen on for incoming packets, while every other use of
rt_ifa_add is for adding addresses on local interfaces. MPLS does
this cos the addresses involved are in basically the same shape as
ones used for setting up local addresses.
It is appropriate for interfaces to want RTF_MPATH on local addresses,
but in the MPLS case it means you can have multiple local things
listening on the same label, which doesn't actually work. mpe in
particular keeps track of in use labels to it can handle collisions,
however, mpw does not. It is currently possible to have multiple
mpw interfaces on the same local label, and sharing the same label
as mpe or possible normal forwarding labels.
Moving the RTF_MPATH flag out of rt_ifa_add means all the callers
that still want it need to pass it themselves. The mpe and mpw
callers are left alone without the flag, and will now get EEXIST
from rt_ifa_add when a label is already in use.
ok (and a huge amount of patience and help) mpi@
claudio@ is ok with the idea, but saw a much much earlier solution
to the problem
|
|
the network mask. This saves converting the prefixlen to a mask and back.
OK phessler@, benno@
|
|
RTF_LOCAL entries or static ARP entries don't have parents, so the logic
was incorrect. Note that it might be possible to extend the logic to work
with non-cloned L2 entries but the few use cases do not justify the
complexity (yet).
Problem reported & fix tested by Elie Bouttier.
ok bluhm@, visa@, claudio@
|
|
|
|
ok claudio@
|
|
ok visa@, tb@
|
|
Input bluhm
OK benno, kn, claudio
|
|
route entry.
This makes sure we pass the correct size to free(9).
Reproted by and ok dlg@
|
|
entry that has been cloned from a different RTF_CLONING route.
Bug report & ok friehm@
|
|
ok claudio@, jmatthew@
|
|
the correct one to clone the gateway.
Fix wired vs wireless on the same subnet issue as well as a more
complicated setup reported by dlg@.
ok jmatthew@, claudio@, dlg@
|
|
This will be needed to select the proper cloning route in a multipath
scenario.
While here remove a NET_ASSERT_LOCKED(), the routing table doesn't need
the lock.
ok dlg@
|
|
still had this hack in. This needs to be revisted and better understood.
It may be needed to add a mplsrdomain to mpe(4) but MPLS only in the rtable 0
is hardcoded in more places and we should fix them all.
OK mpi@
|
|
no entry are missed.
While here do not re-ordered or send messages for route entries that are
already in the expected state.
Make rttest30 pass.
ok gerhard@
|
|
Tested by Hrvoje Popovski, ok bluhm@
|
|
ok bluhm@, florian@
|
|
OK mpi
|
|
Prompted by a bugreport by naddy that IPv6 autoconfiguration is broken
in the installer.
OK mpi, "go for it" deraadt
|
|
rtdeletemsg().
ok bluhm@
|
|
Reduce differences with rtm_miss().
ok claudio@, bluhm@
|
|
So rename it to rtm_getifa(), move it where it belongs and stop calling
it from rtrequest(9). Route entries created by the kernel must always
specify the corresponding `ifa'.
ok claudio@
|
|
try to remove a route from the table if it is and invalid cache.
This is a step towards decoupling code dealing with userland and kernel
inserted routes.
ok bluhm@
|
|
aren't protected by the NET_LOCK().
While here change lock assertions in rt_{set,put}gwroute(), the NET_LOCK()
is enough.
Tested by Hrvoje Popovski.
ok jmatthew@, claudio@
|
|
so use rtable_l2() to get the right id. Fixes adding routes to rtables.
OK mpi@ phessler@
|
|
ok visa@
|
|
No binary change.
OK mpi@
|
|
them all in net/rtsock.c.
This allows to easily spot which functions are doing a copyout(9)
when dealing with the routing midlayer.
ok phessler@, bluhm@, dhill@, krw@, claudio@
|
|
OK claudio@ mpi@
|
|
rtalloc(9) should be reserved for the hot path otherwise it's hard
to interpret the value of the 'use' counter.
ok claudio@
|
|
OK mikeb@
|
|
This makes the API simpler, and is probably more useful than spreading
counters memory other several types, making it harder to track.
Prodded by mpi, ok mpi@ stsp@
|
|
rectification.
|
|
OK mpi@
|