[PATCH] osmo-ggsn[master]: gtpie_decaps: const-ify pointer to input packet data

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Oct 13 14:28:08 UTC 2017


Review at  https://gerrit.osmocom.org/4253

gtpie_decaps: const-ify pointer to input packet data

Change-Id: Ia048abcd80f29581c6ac02cd7f534f2617005671
---
M gtp/gtpie.c
M gtp/gtpie.h
2 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/53/4253/1

diff --git a/gtp/gtpie.c b/gtp/gtpie.c
index 4cfb373..6ffa184 100644
--- a/gtp/gtpie.c
+++ b/gtp/gtpie.c
@@ -304,13 +304,13 @@
  *  \param[in] pack Pointer to raw GTP packet (payload part)
  *  \param[in] len Length of \a pack in bytes
  *  \returns 0 on sucess; EOF in case IE not found */
-int gtpie_decaps(union gtpie_member *ie[], int version, void *pack,
+int gtpie_decaps(union gtpie_member *ie[], int version, const void *pack,
 		 unsigned len)
 {
 	int i;
 	int j = 0;
-	unsigned char *p;
-	unsigned char *end;
+	const unsigned char *p;
+	const unsigned char *end;
 
 	end = (unsigned char *)pack + len;
 	p = pack;
diff --git a/gtp/gtpie.h b/gtp/gtpie.h
index 96ff67a..fa70274 100644
--- a/gtp/gtpie.h
+++ b/gtp/gtpie.h
@@ -248,7 +248,7 @@
 			uint64_t * dst);
 
 extern int gtpie_decaps(union gtpie_member *ie[], int version,
-			void *pack, unsigned len);
+			const void *pack, unsigned len);
 extern int gtpie_encaps(union gtpie_member *ie[], void *pack, unsigned *len);
 extern int gtpie_encaps2(union gtpie_member ie[], unsigned int size,
 			 void *pack, unsigned *len);

-- 
To view, visit https://gerrit.osmocom.org/4253
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia048abcd80f29581c6ac02cd7f534f2617005671
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>


More information about the gerrit-log mailing list