]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - net/x25/x25_subr.c
networking: introduce and use skb_put_data()
[mirror_ubuntu-artful-kernel.git] / net / x25 / x25_subr.c
index 6b5af65f491fb2e6112a0d0f1b510308e1b28c51..eb466ece1730998550ba65d3cf65fc8fdf363d59 100644 (file)
@@ -188,17 +188,14 @@ void x25_write_internal(struct sock *sk, int frametype)
                        *dptr++ = X25_CALL_REQUEST;
                        len     = x25_addr_aton(addresses, &x25->dest_addr,
                                                &x25->source_addr);
-                       dptr    = skb_put(skb, len);
-                       memcpy(dptr, addresses, len);
+                       dptr = skb_put_data(skb, addresses, len);
                        len     = x25_create_facilities(facilities,
                                        &x25->facilities,
                                        &x25->dte_facilities,
                                        x25->neighbour->global_facil_mask);
-                       dptr    = skb_put(skb, len);
-                       memcpy(dptr, facilities, len);
-                       dptr = skb_put(skb, x25->calluserdata.cudlength);
-                       memcpy(dptr, x25->calluserdata.cuddata,
-                              x25->calluserdata.cudlength);
+                       dptr = skb_put_data(skb, facilities, len);
+                       dptr = skb_put_data(skb, x25->calluserdata.cuddata,
+                                           x25->calluserdata.cudlength);
                        x25->calluserdata.cudlength = 0;
                        break;
 
@@ -210,17 +207,15 @@ void x25_write_internal(struct sock *sk, int frametype)
                                                        &x25->facilities,
                                                        &x25->dte_facilities,
                                                        x25->vc_facil_mask);
-                       dptr    = skb_put(skb, len);
-                       memcpy(dptr, facilities, len);
+                       dptr = skb_put_data(skb, facilities, len);
 
                        /* fast select with no restriction on response
                                allows call user data. Userland must
                                ensure it is ours and not theirs */
                        if(x25->facilities.reverse & 0x80) {
-                               dptr = skb_put(skb,
-                                       x25->calluserdata.cudlength);
-                               memcpy(dptr, x25->calluserdata.cuddata,
-                                      x25->calluserdata.cudlength);
+                               dptr = skb_put_data(skb,
+                                                   x25->calluserdata.cuddata,
+                                                   x25->calluserdata.cudlength);
                        }
                        x25->calluserdata.cudlength = 0;
                        break;