Merge "clat: enable PACKET_AUXDATA cmsg reception"
This commit is contained in:
commit
b5cfb6426c
1 changed files with 7 additions and 0 deletions
|
|
@ -19,6 +19,7 @@
|
|||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <inttypes.h>
|
||||
#include <linux/if_packet.h>
|
||||
#include <linux/if_tun.h>
|
||||
#include <linux/ioctl.h>
|
||||
#include <log/log.h>
|
||||
|
|
@ -181,6 +182,12 @@ static jint com_android_server_connectivity_ClatCoordinator_openPacketSocket(JNI
|
|||
throwIOException(env, "packet socket failed", errno);
|
||||
return -1;
|
||||
}
|
||||
int on = 1;
|
||||
if (setsockopt(sock, SOL_PACKET, PACKET_AUXDATA, &on, sizeof(on))) {
|
||||
throwIOException(env, "packet socket auxdata enablement failed", errno);
|
||||
close(sock);
|
||||
return -1;
|
||||
}
|
||||
return sock;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue