gtp: let userspace handle packets for invalid tunnels
authorAndreas Schultz <aschultz@tpip.net>
Thu, 26 Jan 2017 15:21:49 +0000 (16:21 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 29 Jan 2017 18:54:00 +0000 (13:54 -0500)
enable userspace to send error replies for invalid tunnels

Acked-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: Andreas Schultz <aschultz@tpip.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/gtp.c

index e11a1ead3228748c175af49a0d8ec16a9a809e76..bda0c64134508cf5dd786d3f698bd45884dcce57 100644 (file)
@@ -198,12 +198,12 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb,
        pctx = gtp0_pdp_find(gtp, be64_to_cpu(gtp0->tid));
        if (!pctx) {
                netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb);
-               return -1;
+               return 1;
        }
 
        if (!gtp_check_src_ms(skb, pctx, hdrlen)) {
                netdev_dbg(gtp->dev, "No PDP ctx for this MS\n");
-               return -1;
+               return 1;
        }
 
        /* Get rid of the GTP + UDP headers. */
@@ -247,12 +247,12 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb,
        pctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid));
        if (!pctx) {
                netdev_dbg(gtp->dev, "No PDP ctx to decap skb=%p\n", skb);
-               return -1;
+               return 1;
        }
 
        if (!gtp_check_src_ms(skb, pctx, hdrlen)) {
                netdev_dbg(gtp->dev, "No PDP ctx for this MS\n");
-               return -1;
+               return 1;
        }
 
        /* Get rid of the GTP + UDP headers. */