diff options
Diffstat (limited to 'net/x25')
-rw-r--r-- | net/x25/af_x25.c | 22 | ||||
-rw-r--r-- | net/x25/x25_dev.c | 4 | ||||
-rw-r--r-- | net/x25/x25_in.c | 14 | ||||
-rw-r--r-- | net/x25/x25_out.c | 6 |
4 files changed, 31 insertions, 15 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: |
diff --git a/net/x25/x25_dev.c b/net/x25/x25_dev.c index c7221de98a95..848a6b6f90a6 100644 --- a/net/x25/x25_dev.c +++ b/net/x25/x25_dev.c | |||
@@ -48,7 +48,7 @@ static int x25_receive_data(struct sk_buff *skb, struct x25_neigh *nb) | |||
48 | if ((sk = x25_find_socket(lci, nb)) != NULL) { | 48 | if ((sk = x25_find_socket(lci, nb)) != NULL) { |
49 | int queued = 1; | 49 | int queued = 1; |
50 | 50 | ||
51 | skb->h.raw = skb->data; | 51 | skb_reset_transport_header(skb); |
52 | bh_lock_sock(sk); | 52 | bh_lock_sock(sk); |
53 | if (!sock_owned_by_user(sk)) { | 53 | if (!sock_owned_by_user(sk)) { |
54 | queued = x25_process_rx_frame(sk, skb); | 54 | queued = x25_process_rx_frame(sk, skb); |
@@ -191,7 +191,7 @@ void x25_send_frame(struct sk_buff *skb, struct x25_neigh *nb) | |||
191 | { | 191 | { |
192 | unsigned char *dptr; | 192 | unsigned char *dptr; |
193 | 193 | ||
194 | skb->nh.raw = skb->data; | 194 | skb_reset_network_header(skb); |
195 | 195 | ||
196 | switch (nb->dev->type) { | 196 | switch (nb->dev->type) { |
197 | case ARPHRD_X25: | 197 | case ARPHRD_X25: |
diff --git a/net/x25/x25_in.c b/net/x25/x25_in.c index c5239fcdefa0..1c88762c2794 100644 --- a/net/x25/x25_in.c +++ b/net/x25/x25_in.c | |||
@@ -53,17 +53,20 @@ static int x25_queue_rx_frame(struct sock *sk, struct sk_buff *skb, int more) | |||
53 | 53 | ||
54 | skb_queue_tail(&x25->fragment_queue, skb); | 54 | skb_queue_tail(&x25->fragment_queue, skb); |
55 | 55 | ||
56 | skbn->h.raw = skbn->data; | 56 | skb_reset_transport_header(skbn); |
57 | 57 | ||
58 | skbo = skb_dequeue(&x25->fragment_queue); | 58 | skbo = skb_dequeue(&x25->fragment_queue); |
59 | memcpy(skb_put(skbn, skbo->len), skbo->data, skbo->len); | 59 | skb_copy_from_linear_data(skbo, skb_put(skbn, skbo->len), |
60 | skbo->len); | ||
60 | kfree_skb(skbo); | 61 | kfree_skb(skbo); |
61 | 62 | ||
62 | while ((skbo = | 63 | while ((skbo = |
63 | skb_dequeue(&x25->fragment_queue)) != NULL) { | 64 | skb_dequeue(&x25->fragment_queue)) != NULL) { |
64 | skb_pull(skbo, (x25->neighbour->extended) ? | 65 | skb_pull(skbo, (x25->neighbour->extended) ? |
65 | X25_EXT_MIN_LEN : X25_STD_MIN_LEN); | 66 | X25_EXT_MIN_LEN : X25_STD_MIN_LEN); |
66 | memcpy(skb_put(skbn, skbo->len), skbo->data, skbo->len); | 67 | skb_copy_from_linear_data(skbo, |
68 | skb_put(skbn, skbo->len), | ||
69 | skbo->len); | ||
67 | kfree_skb(skbo); | 70 | kfree_skb(skbo); |
68 | } | 71 | } |
69 | 72 | ||
@@ -112,8 +115,9 @@ static int x25_state1_machine(struct sock *sk, struct sk_buff *skb, int frametyp | |||
112 | * Copy any Call User Data. | 115 | * Copy any Call User Data. |
113 | */ | 116 | */ |
114 | if (skb->len >= 0) { | 117 | if (skb->len >= 0) { |
115 | memcpy(x25->calluserdata.cuddata, skb->data, | 118 | skb_copy_from_linear_data(skb, |
116 | skb->len); | 119 | x25->calluserdata.cuddata, |
120 | skb->len); | ||
117 | x25->calluserdata.cudlength = skb->len; | 121 | x25->calluserdata.cudlength = skb->len; |
118 | } | 122 | } |
119 | if (!sock_flag(sk, SOCK_DEAD)) | 123 | if (!sock_flag(sk, SOCK_DEAD)) |
diff --git a/net/x25/x25_out.c b/net/x25/x25_out.c index 6f5737853912..2b96b52114d6 100644 --- a/net/x25/x25_out.c +++ b/net/x25/x25_out.c | |||
@@ -61,7 +61,7 @@ int x25_output(struct sock *sk, struct sk_buff *skb) | |||
61 | 61 | ||
62 | if (skb->len - header_len > max_len) { | 62 | if (skb->len - header_len > max_len) { |
63 | /* Save a copy of the Header */ | 63 | /* Save a copy of the Header */ |
64 | memcpy(header, skb->data, header_len); | 64 | skb_copy_from_linear_data(skb, header, header_len); |
65 | skb_pull(skb, header_len); | 65 | skb_pull(skb, header_len); |
66 | 66 | ||
67 | frontlen = skb_headroom(skb); | 67 | frontlen = skb_headroom(skb); |
@@ -84,12 +84,12 @@ int x25_output(struct sock *sk, struct sk_buff *skb) | |||
84 | len = max_len > skb->len ? skb->len : max_len; | 84 | len = max_len > skb->len ? skb->len : max_len; |
85 | 85 | ||
86 | /* Copy the user data */ | 86 | /* Copy the user data */ |
87 | memcpy(skb_put(skbn, len), skb->data, len); | 87 | skb_copy_from_linear_data(skb, skb_put(skbn, len), len); |
88 | skb_pull(skb, len); | 88 | skb_pull(skb, len); |
89 | 89 | ||
90 | /* Duplicate the Header */ | 90 | /* Duplicate the Header */ |
91 | skb_push(skbn, header_len); | 91 | skb_push(skbn, header_len); |
92 | memcpy(skbn->data, header, header_len); | 92 | skb_copy_to_linear_data(skbn, header, header_len); |
93 | 93 | ||
94 | if (skb->len > 0) { | 94 | if (skb->len > 0) { |
95 | if (x25->neighbour->extended) | 95 | if (x25->neighbour->extended) |