Catch tcpip.ErrClosedForSend errors while forwarding. This may occur if
an endpoint is being shutdown at the same time as it's being used to
forward a packet.
PiperOrigin-RevId: 695452542
Marks the structs in netstack as savable. This does not change or break any
existing behavior as the netstack itself is not savable yet.
PiperOrigin-RevId: 635943481
Cancel the delayed report job when operating in V2 mode (this already
happens in V1 mode) in MakeAllNonMemberLocked, which is called on
endpoint Disable. This prevents a panic inside the delayed report
job where it asserts that the protocol is enabled.
PiperOrigin-RevId: 588113303
It is an idea of running codespell as part of our presubmit checks.
Before enabling it for new changes, let's fix what it has found.
Signed-off-by: Andrei Vagin <avagin@gmail.com>
The important change here is in tcpip/tcpip.go, where tcpip.Address is defined.
The rest is updating uses of tcpip.Address.
This is preparation for netip.Addr or []byte based addresses, which should save
us a bunch of allocations. Currently, we allocate every time we want to, say,
get a tcpip.Address from a header. This is because the header is a byte slice,
but Address is a string. Strings are immutable, so Go allocates and copies.
PiperOrigin-RevId: 532284732
Leave the generic multicast protocol in V1 mode even when transitioning
all groups to non-member state (when interface is disabled).
Updates #8346
PiperOrigin-RevId: 508448263
This change sends multiple records into a single IGMPv3/MLDv2 report
instead of a single record per report when enabling IGMPv3/MLDv2.
Updates #8346
PiperOrigin-RevId: 501941751
When the state changed timer fires, instead of sending a single record
per report, send as many records as possible per report message.
Updates #8346
PiperOrigin-RevId: 501932735
This change sends multiple records into a single IGMPv3/MLDv2 report
instead of a single record per report when disabling IGMPv3/MLDv2.
Updates #8346
PiperOrigin-RevId: 501419672
This change introduces support for MLDv2/IGMPv3. Note that this change
does not yet introduce APIs to perform source filtering so SSM is not
yet supported. Also note that this change does not yet coalesce records
in a report as that will come in a follow-up.
Updates #8346
PiperOrigin-RevId: 501336347
Instead of passing each of the values as arguments to a function.
This prepares for a followup change which introduces a new field
to mockMulticastGroupProtocol that is unused in some places
(improving readability by not having to explicitly pass in a
function argument).
PiperOrigin-RevId: 495918528
This change removes the explicit `state`/`hostState` fields from the
generic multicast host state and instead uses other readily available
or other newly introduced fields that more explicitly describe what
actions are pending for a host's group membership.
1) `delayedReportJobFiresAt` already lets us know if we are in the
"delaying" member state/have a timer scheduled.
2) `transmissionLeft` lets us know if we have pending reports to send.
This prepares us to use the same state machine to support both
MLDv1/IGMPv2 and MLDv2/IGMPv3. Note that MLDv2/IGMPv3 do not use the
same "state machine" as MLDv1/IGMPv2. Specifically, states like
"Non-Listener/Member", "Delaying Listener/Member" and
"Idle Listener/Member" do not exist in MLDv2/IGMPv3.
PiperOrigin-RevId: 495386469
ErrNoRoute gets translated to EHOSTUNREACH which causes some code paths to
produce different errors unexpectedly. Rename the error so we can clean up some
sites to return ENETUNREACH more clearly where needed.
Updates #8105
PiperOrigin-RevId: 482355099
This change implements AddMulticastRoute and the requisite routing logic.
Subsequent changes will still be needed to:
1. Emit events for missing route or unexpected input interface
2. Implement DelRoute
3. Implement GetRouteStats
Updates #7338.
PiperOrigin-RevId: 451026594
This change makes the checklocks analyzer considerable more powerful, adding:
* The ability to traverse complex structures, e.g. to have multiple nested
fields as part of the annotation.
* The ability to resolve simple anonymous functions and closures, and perform
lock analysis across these invocations. This does not apply to closures that
are passed elsewhere, since it is not possible to know the context in which
they might be invoked.
* The ability to annotate return values in addition to receivers and other
parameters, with the same complex structures noted above.
* Ignoring locking semantics for "fresh" objects, i.e. objects that are
allocated in the local frame (typically a new-style function).
* Sanity checking of locking state across block transitions and returns, to
ensure that no unexpected locks are held.
Note that initially, most of these findings are excluded by a comprehensive
nogo.yaml. The findings that are included are fundamental lock violations.
The changes here should be relatively low risk, minor refactorings to either
include necessary annotations to simplify the code structure (in general
removing closures in favor of methods) so that the analyzer can be easily
track the lock state.
This change additional includes two changes to nogo itself:
* Sanity checking of all types to ensure that the binary and ast-derived
types have a consistent objectpath, to prevent the bug above from occurring
silently (and causing much confusion). This also requires a trick in
order to ensure that serialized facts are consumable downstream. This can
be removed with https://go-review.googlesource.com/c/tools/+/331789 merged.
* A minor refactoring to isolation the objdump settings in its own package.
This was originally used to implement the sanity check above, but this
information is now being passed another way. The minor refactor is preserved
however, since it cleans up the code slightly and is minimal risk.
PiperOrigin-RevId: 382613300
Introduce tcpip.MonotonicTime; replace int64 in tcpip.Clock method
returns with time.Time and MonotonicTime to improve type safety and
ensure that monotonic clock readings are never compared to wall clock
readings.
PiperOrigin-RevId: 375775907