aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
diff options
context:
space:
mode:
authorSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>2017-12-11 17:30:13 -0700
committerDavid S. Miller <davem@davemloft.net>2017-12-13 14:01:08 -0500
commit74692caf1b0bd14454e61da1b7cd04254964beff (patch)
treeb84b00b5d68f9a1f3de7c3b873d8ed0a2324a900 /drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
parentnet: qualcomm: rmnet: Allow only one rmnet dev per muxid per real dev (diff)
downloadwireguard-linux-74692caf1b0bd14454e61da1b7cd04254964beff.tar.xz
wireguard-linux-74692caf1b0bd14454e61da1b7cd04254964beff.zip
net: qualcomm: rmnet: Process packets over ethernet
Add support to send and receive packets over ethernet. An example of usage is testing the data path on UML. This can be achieved by setting up two UML instances in multicast mode and associating rmnet over the UML ethernet device. Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c')
-rw-r--r--drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
index a46053ce6b24..05539321ba3a 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
@@ -15,6 +15,7 @@
#include <linux/netdevice.h>
#include <linux/netdev_features.h>
+#include <linux/if_arp.h>
#include "rmnet_private.h"
#include "rmnet_config.h"
#include "rmnet_vnd.h"
@@ -104,6 +105,15 @@ rmnet_map_ingress_handler(struct sk_buff *skb,
{
struct sk_buff *skbn;
+ if (skb->dev->type == ARPHRD_ETHER) {
+ if (pskb_expand_head(skb, ETH_HLEN, 0, GFP_KERNEL)) {
+ kfree_skb(skb);
+ return;
+ }
+
+ skb_push(skb, ETH_HLEN);
+ }
+
if (port->ingress_data_format & RMNET_INGRESS_FORMAT_DEAGGREGATION) {
while ((skbn = rmnet_map_deaggregate(skb)) != NULL)
__rmnet_map_ingress_handler(skbn, port);