diff options
Diffstat (limited to 'net/x25/af_x25.c')
-rw-r--r-- | net/x25/af_x25.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index e62ba41b05c5..0d6002fc77b2 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c | |||
@@ -951,7 +951,7 @@ int x25_rx_call_request(struct sk_buff *skb, struct x25_neigh *nb, | |||
951 | * Incoming Call User Data. | 951 | * Incoming Call User Data. |
952 | */ | 952 | */ |
953 | if (skb->len >= 0) { | 953 | if (skb->len >= 0) { |
954 | memcpy(makex25->calluserdata.cuddata, skb->data, skb->len); | 954 | skb_copy_from_linear_data(skb, makex25->calluserdata.cuddata, skb->len); |
955 | makex25->calluserdata.cudlength = skb->len; | 955 | makex25->calluserdata.cudlength = skb->len; |
956 | } | 956 | } |
957 | 957 | ||
@@ -1058,9 +1058,10 @@ static int x25_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1058 | */ | 1058 | */ |
1059 | SOCK_DEBUG(sk, "x25_sendmsg: Copying user data\n"); | 1059 | SOCK_DEBUG(sk, "x25_sendmsg: Copying user data\n"); |
1060 | 1060 | ||
1061 | asmptr = skb->h.raw = skb_put(skb, len); | 1061 | skb_reset_transport_header(skb); |
1062 | skb_put(skb, len); | ||
1062 | 1063 | ||
1063 | rc = memcpy_fromiovec(asmptr, msg->msg_iov, len); | 1064 | rc = memcpy_fromiovec(skb_transport_header(skb), msg->msg_iov, len); |
1064 | if (rc) | 1065 | if (rc) |
1065 | goto out_kfree_skb; | 1066 | goto out_kfree_skb; |
1066 | 1067 | ||
@@ -1210,8 +1211,7 @@ static int x25_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1210 | } | 1211 | } |
1211 | } | 1212 | } |
1212 | 1213 | ||
1213 | skb->h.raw = skb->data; | 1214 | skb_reset_transport_header(skb); |
1214 | |||
1215 | copied = skb->len; | 1215 | copied = skb->len; |
1216 | 1216 | ||
1217 | if (copied > size) { | 1217 | if (copied > size) { |
@@ -1280,6 +1280,12 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | |||
1280 | rc = sock_get_timestamp(sk, | 1280 | rc = sock_get_timestamp(sk, |
1281 | (struct timeval __user *)argp); | 1281 | (struct timeval __user *)argp); |
1282 | break; | 1282 | break; |
1283 | case SIOCGSTAMPNS: | ||
1284 | rc = -EINVAL; | ||
1285 | if (sk) | ||
1286 | rc = sock_get_timestampns(sk, | ||
1287 | (struct timespec __user *)argp); | ||
1288 | break; | ||
1283 | case SIOCGIFADDR: | 1289 | case SIOCGIFADDR: |
1284 | case SIOCSIFADDR: | 1290 | case SIOCSIFADDR: |
1285 | case SIOCGIFDSTADDR: | 1291 | case SIOCGIFDSTADDR: |
@@ -1521,6 +1527,12 @@ static int compat_x25_ioctl(struct socket *sock, unsigned int cmd, | |||
1521 | rc = compat_sock_get_timestamp(sk, | 1527 | rc = compat_sock_get_timestamp(sk, |
1522 | (struct timeval __user*)argp); | 1528 | (struct timeval __user*)argp); |
1523 | break; | 1529 | break; |
1530 | case SIOCGSTAMPNS: | ||
1531 | rc = -EINVAL; | ||
1532 | if (sk) | ||
1533 | rc = compat_sock_get_timestampns(sk, | ||
1534 | (struct timespec __user*)argp); | ||
1535 | break; | ||
1524 | case SIOCGIFADDR: | 1536 | case SIOCGIFADDR: |
1525 | case SIOCSIFADDR: | 1537 | case SIOCSIFADDR: |
1526 | case SIOCGIFDSTADDR: | 1538 | case SIOCGIFDSTADDR: |