Skip to content

Commit

Permalink
Merge pull request torvalds#168 from opurdila/fix-sockaddr
Browse files Browse the repository at this point in the history
Fix sockaddr
  • Loading branch information
Octavian Purdila authored Jun 18, 2016
2 parents 0609875 + 059a2dc commit e9c3b4a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
12 changes: 8 additions & 4 deletions arch/lkl/include/uapi/asm/syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ typedef __s64 s64;

#define __user

#define sockaddr __lkl__kernel_sockaddr_storage

#include <asm/unistd.h>
/* Temporary undefine system calls that don't have data types defined in UAPI
* headers */
Expand Down Expand Up @@ -92,6 +90,14 @@ typedef __s64 s64;
#include <asm/siginfo.h>
#include <linux/utime.h>
#include <asm/socket.h>

/* Define data structures used in system calls that are not defined in UAPI
* headers */
struct sockaddr {
unsigned short int sa_family;
char sa_data[14];
};

#include <linux/if.h>
#define __UAPI_DEF_IN_IPPROTO 1
#define __UAPI_DEF_IN_ADDR 1
Expand All @@ -110,8 +116,6 @@ typedef __s64 s64;
#include <linux/virtio_net.h>
#include <linux/virtio_ring.h>

/* Define data structures used in system calls that are not defined in UAPI
* headers */
struct user_msghdr {
void __user *msg_name; /* ptr to socket address structure */
int msg_namelen; /* size of socket address structure */
Expand Down
2 changes: 1 addition & 1 deletion tools/lkl/tests/net-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static int test_icmp(char *str, int len)
inet_aton(dst, &saddr.sin_addr);

ret = lkl_sys_sendto(sock, icmp, sizeof(*icmp), 0,
(struct __lkl__kernel_sockaddr_storage *)&saddr,
(struct lkl_sockaddr*)&saddr,
sizeof(saddr));
if (ret < 0) {
snprintf(str, len, "sendto error (%s)", strerror(errno));
Expand Down
4 changes: 2 additions & 2 deletions tools/lkl/tests/run_netperf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ then
exit 1
fi

function clean {
clean() {
sudo killall netserver &> /dev/null || true
}

function clean_with_tap {
clean_with_tap() {
sudo ip link set dev $LKL_HIJACK_NET_IFPARAMS down &> /dev/null || true
sudo ip tuntap del dev $LKL_HIJACK_NET_IFPARAMS mode tap &> /dev/null || true
clean
Expand Down

0 comments on commit e9c3b4a

Please sign in to comment.