Key length used in DeserializeSerialise XfrmAlgo tests is
endianess dependant. Correction needed to have
TestXfrmAlgoDeserializeSerialize and
TestXfrmAlgoAuthDeserializeSerialize
pass ok on ppc64 arch (big endian).
The mode on macvtap interfaces was not being set correctly.
Due to this the mode on macvtap is always set to default.
Set the mode correctly and add unit tests to check the same
This fixes issue https://github.com/vishvananda/netlink/issues/136
Signed-off-by: Manohar Castelino <manohar.r.castelino@intel.com>
- It is part of the ID and it is needed when you
program policies for different SAs which share
same src and dst
Signed-off-by: Alessandro Boch <aboch@docker.com>
An issue happens when netlink.LinkSubscribe is called back to back, even
when there is a Close() of the netlink socket (via the done chan
parameter). The issue seems to stem from the fact that after the
close/open happen together, the same fd is allocated. This lets the
s.Receive() calls succeed in more than one goroutine, which causes the
updates to issue randomly since the same fd has multiple readers and the
original Subscribe never finishes.
After a Close(), mark the Socket as invalid (-1) so that calls to
Send()/Receive() will fail going forward.
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
- Currently they are not and GET methods are passing
the wrong structure. Also they are setting the incorrect
XFRM_F_DUMP flag. Because of this, current get methods
do not return expected error when query target is not found.
Signed-off-by: Alessandro Boch <aboch@docker.com>
- Package methods only need an empty handle.
Not a regular Handle with a couple of
sockets creation/delete.
Signed-off-by: Alessandro Boch <aboch@docker.com>
- Ties to a netlink socket. All client requests
will re-use same socket. Socket released at
handle deletion.
- Also network namespace can be specified during
handle creation. Socket will be opened on the
specified network namespace.
Signed-off-by: Alessandro Boch <aboch@docker.com>
* Add Mark to xrfm state
Signed-off-by: Alessandro Boch <aboch@docker.com>
* Add Mark to xfrm policies
Signed-off-by: Alessandro Boch <aboch@docker.com>
New in kernel 4.5 is a type of qdisc for lightweight (no qdisc lock)
ingress/egress parsing, called clsact. Add support for such a qdisc
type.
One primary consumer of clsact is the bpf filter, add support for that
as well.
Current U32 filter only supports redirect action, but the U32 can
support a lot more. Refactor a bit the action generating/parsing logic
to be more generic and add BPF action support.
When creating a U32 filter, one can supply an array of Actions, which
will be executed by the U32 filter in order:
* The new MirredAction implements the same functionality as RedirIndex
field in the U32 filter, with that static field kept in the struct for
backwards compatibility.
* A new BpfAction type is added which allows a program with an open bpf
file descriptor (implementation is out of scope of this patch) to be
added as well.
Add a test for the above use case which includes one of each type of
action.