netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Schultz <aschultz@tpip.net>
To: Pablo Neira <pablo@netfilter.org>
Cc: netdev@vger.kernel.org,
	Lionel Gauthier <Lionel.Gauthier@eurecom.fr>,
	openbsc@lists.osmocom.org, Harald Welte <laforge@gnumonks.org>,
	SF Markus Elfring <elfring@users.sourceforge.net>
Subject: [PATCH net-next v2 2/2] gtp: let userspace handle packets for invalid tunnels
Date: Thu, 26 Jan 2017 16:21:49 +0100	[thread overview]
Message-ID: <20170126152149.3284-3-aschultz@tpip.net> (raw)
In-Reply-To: <20170126152149.3284-1-aschultz@tpip.net>

enable userspace to send error replies for invalid tunnels

Acked-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: Andreas Schultz <aschultz@tpip.net>
---
 drivers/net/gtp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
index 5c63a37..5dd7de6 100644
--- a/drivers/net/gtp.c
+++ b/drivers/net/gtp.c
@@ -199,12 +199,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. */
@@ -248,12 +248,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. */
-- 
2.10.2

  parent reply	other threads:[~2017-01-26 15:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26 15:21 [PATCH net-next v2 0/2] gtp: simple gtp improvements Andreas Schultz
2017-01-26 15:21 ` [PATCH net-next v2 1/2] gtp: remove unnecessary rcu_read_lock Andreas Schultz
2017-01-26 15:21 ` Andreas Schultz [this message]
2017-01-29 18:56 ` [PATCH net-next v2 0/2] gtp: simple gtp improvements David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170126152149.3284-3-aschultz@tpip.net \
    --to=aschultz@tpip.net \
    --cc=Lionel.Gauthier@eurecom.fr \
    --cc=elfring@users.sourceforge.net \
    --cc=laforge@gnumonks.org \
    --cc=netdev@vger.kernel.org \
    --cc=openbsc@lists.osmocom.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).