aboutsummaryrefslogtreecommitdiffstats
path: root/net/x25/af_x25.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-27 12:26:46 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-27 12:26:46 -0400
commit15c54033964a943de7b0763efd3bd0ede7326395 (patch)
tree840b292612d1b5396d5bab5bde537a9013db3ceb /net/x25/af_x25.c
parentad5da3cf39a5b11a198929be1f2644e17ecd767e (diff)
parent912a41a4ab935ce8c4308428ec13fc7f8b1f18f4 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (448 commits) [IPV4] nl_fib_lookup: Initialise res.r before fib_res_put(&res) [IPV6]: Fix thinko in ipv6_rthdr_rcv() changes. [IPV4]: Add multipath cached to feature-removal-schedule.txt [WIRELESS] cfg80211: Clarify locking comment. [WIRELESS] cfg80211: Fix locking in wiphy_new. [WEXT] net_device: Don't include wext bits if not required. [WEXT]: Misc code cleanups. [WEXT]: Reduce inline abuse. [WEXT]: Move EXPORT_SYMBOL statements where they belong. [WEXT]: Cleanup early ioctl call path. [WEXT]: Remove options. [WEXT]: Remove dead debug code. [WEXT]: Clean up how wext is called. [WEXT]: Move to net/wireless [AFS]: Eliminate cmpxchg() usage in vlocation code. [RXRPC]: Fix pointers passed to bitops. [RXRPC]: Remove bogus atomic_* overrides. [AFS]: Fix u64 printing in debug logging. [AFS]: Add "directory write" support. [AFS]: Implement the CB.InitCallBackState3 operation. ...
Diffstat (limited to 'net/x25/af_x25.c')
-rw-r--r--net/x25/af_x25.c22
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: