clat: just always set mark unconditionally
Setting SO_MARK to MARK_UNSET, ie. 0, is harmless,
since the default for a brand new socket is already 0.
Setsockopt(SOL_SOCKET, SO_MARK) requires NET_RAW or NET_ADMIN,
while socket(AF_INET6, SOCK_RAW) already requires NET_RAW,
so we should already have the permission.
This allows us to get rid of an extra #define MARK_UNSET definition.
Additionally in practice mark should never be 0 anyway,
since we desire the socket to be flagged as having PERMISSION_SYSTEM
(if it's not routing will break if upstream device is on a restricted
network).
See ClatCoordinator.java getFwMark() for the mark we actually pass in,
which is guaranteed to have at least 4 bits (16,17,18,19) set.
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I834f4f1d331bfa88f56593c9cc1abef15d94d185
1 file changed