aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/irda/af_irda.c19
-rw-r--r--net/netrom/af_netrom.c7
-rw-r--r--net/rose/af_rose.c5
-rw-r--r--net/x25/af_x25.c5
4 files changed, 18 insertions, 18 deletions
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index c3cd2ba123e5..bf994c85e45a 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -1274,7 +1274,6 @@ static int irda_sendmsg(struct kiocb *iocb, struct socket *sock,
1274 struct sock *sk = sock->sk; 1274 struct sock *sk = sock->sk;
1275 struct irda_sock *self; 1275 struct irda_sock *self;
1276 struct sk_buff *skb; 1276 struct sk_buff *skb;
1277 unsigned char *asmptr;
1278 int err; 1277 int err;
1279 1278
1280 IRDA_DEBUG(4, "%s(), len=%zd\n", __FUNCTION__, len); 1279 IRDA_DEBUG(4, "%s(), len=%zd\n", __FUNCTION__, len);
@@ -1317,9 +1316,9 @@ static int irda_sendmsg(struct kiocb *iocb, struct socket *sock,
1317 return -ENOBUFS; 1316 return -ENOBUFS;
1318 1317
1319 skb_reserve(skb, self->max_header_size + 16); 1318 skb_reserve(skb, self->max_header_size + 16);
1320 1319 skb_reset_transport_header(skb);
1321 asmptr = skb->h.raw = skb_put(skb, len); 1320 skb_put(skb, len);
1322 err = memcpy_fromiovec(asmptr, msg->msg_iov, len); 1321 err = memcpy_fromiovec(skb_transport_header(skb), msg->msg_iov, len);
1323 if (err) { 1322 if (err) {
1324 kfree_skb(skb); 1323 kfree_skb(skb);
1325 return err; 1324 return err;
@@ -1530,7 +1529,6 @@ static int irda_sendmsg_dgram(struct kiocb *iocb, struct socket *sock,
1530 struct sock *sk = sock->sk; 1529 struct sock *sk = sock->sk;
1531 struct irda_sock *self; 1530 struct irda_sock *self;
1532 struct sk_buff *skb; 1531 struct sk_buff *skb;
1533 unsigned char *asmptr;
1534 int err; 1532 int err;
1535 1533
1536 IRDA_DEBUG(4, "%s(), len=%zd\n", __FUNCTION__, len); 1534 IRDA_DEBUG(4, "%s(), len=%zd\n", __FUNCTION__, len);
@@ -1566,10 +1564,11 @@ static int irda_sendmsg_dgram(struct kiocb *iocb, struct socket *sock,
1566 return -ENOBUFS; 1564 return -ENOBUFS;
1567 1565
1568 skb_reserve(skb, self->max_header_size); 1566 skb_reserve(skb, self->max_header_size);
1567 skb_reset_transport_header(skb);
1569 1568
1570 IRDA_DEBUG(4, "%s(), appending user data\n", __FUNCTION__); 1569 IRDA_DEBUG(4, "%s(), appending user data\n", __FUNCTION__);
1571 asmptr = skb->h.raw = skb_put(skb, len); 1570 skb_put(skb, len);
1572 err = memcpy_fromiovec(asmptr, msg->msg_iov, len); 1571 err = memcpy_fromiovec(skb_transport_header(skb), msg->msg_iov, len);
1573 if (err) { 1572 if (err) {
1574 kfree_skb(skb); 1573 kfree_skb(skb);
1575 return err; 1574 return err;
@@ -1602,7 +1601,6 @@ static int irda_sendmsg_ultra(struct kiocb *iocb, struct socket *sock,
1602 __u8 pid = 0; 1601 __u8 pid = 0;
1603 int bound = 0; 1602 int bound = 0;
1604 struct sk_buff *skb; 1603 struct sk_buff *skb;
1605 unsigned char *asmptr;
1606 int err; 1604 int err;
1607 1605
1608 IRDA_DEBUG(4, "%s(), len=%zd\n", __FUNCTION__, len); 1606 IRDA_DEBUG(4, "%s(), len=%zd\n", __FUNCTION__, len);
@@ -1662,10 +1660,11 @@ static int irda_sendmsg_ultra(struct kiocb *iocb, struct socket *sock,
1662 return -ENOBUFS; 1660 return -ENOBUFS;
1663 1661
1664 skb_reserve(skb, self->max_header_size); 1662 skb_reserve(skb, self->max_header_size);
1663 skb_reset_transport_header(skb);
1665 1664
1666 IRDA_DEBUG(4, "%s(), appending user data\n", __FUNCTION__); 1665 IRDA_DEBUG(4, "%s(), appending user data\n", __FUNCTION__);
1667 asmptr = skb->h.raw = skb_put(skb, len); 1666 skb_put(skb, len);
1668 err = memcpy_fromiovec(asmptr, msg->msg_iov, len); 1667 err = memcpy_fromiovec(skb_transport_header(skb), msg->msg_iov, len);
1669 if (err) { 1668 if (err) {
1670 kfree_skb(skb); 1669 kfree_skb(skb);
1671 return err; 1670 return err;
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index 8d0f30a015df..053fa26ff90a 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -1074,6 +1074,7 @@ static int nr_sendmsg(struct kiocb *iocb, struct socket *sock,
1074 goto out; 1074 goto out;
1075 1075
1076 skb_reserve(skb, size - len); 1076 skb_reserve(skb, size - len);
1077 skb_reset_transport_header(skb);
1077 1078
1078 /* 1079 /*
1079 * Push down the NET/ROM header 1080 * Push down the NET/ROM header
@@ -1094,14 +1095,12 @@ static int nr_sendmsg(struct kiocb *iocb, struct socket *sock,
1094 /* 1095 /*
1095 * Put the data on the end 1096 * Put the data on the end
1096 */ 1097 */
1098 skb_put(skb, len);
1097 1099
1098 skb->h.raw = skb_put(skb, len);
1099
1100 asmptr = skb->h.raw;
1101 SOCK_DEBUG(sk, "NET/ROM: Appending user data\n"); 1100 SOCK_DEBUG(sk, "NET/ROM: Appending user data\n");
1102 1101
1103 /* User data follows immediately after the NET/ROM transport header */ 1102 /* User data follows immediately after the NET/ROM transport header */
1104 if (memcpy_fromiovec(asmptr, msg->msg_iov, len)) { 1103 if (memcpy_fromiovec(skb_transport_header(skb), msg->msg_iov, len)) {
1105 kfree_skb(skb); 1104 kfree_skb(skb);
1106 err = -EFAULT; 1105 err = -EFAULT;
1107 goto out; 1106 goto out;
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index 6d8684a11ac6..1511697b22ba 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -1105,9 +1105,10 @@ static int rose_sendmsg(struct kiocb *iocb, struct socket *sock,
1105 */ 1105 */
1106 SOCK_DEBUG(sk, "ROSE: Appending user data\n"); 1106 SOCK_DEBUG(sk, "ROSE: Appending user data\n");
1107 1107
1108 asmptr = skb->h.raw = skb_put(skb, len); 1108 skb_reset_transport_header(skb);
1109 skb_put(skb, len);
1109 1110
1110 err = memcpy_fromiovec(asmptr, msg->msg_iov, len); 1111 err = memcpy_fromiovec(skb_transport_header(skb), msg->msg_iov, len);
1111 if (err) { 1112 if (err) {
1112 kfree_skb(skb); 1113 kfree_skb(skb);
1113 return err; 1114 return err;
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index fc713059ccdd..adcda8ebee9c 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -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