diff options
author | Elias Summermatter <elias.summermatter@seccom.ch> | 2021-02-18 16:51:47 +0100 |
---|---|---|
committer | Elias Summermatter <elias.summermatter@seccom.ch> | 2021-02-18 16:51:47 +0100 |
commit | 8095b1a1bc73d084d2e0e34a529ea52e17fd7355 (patch) | |
tree | dc07911d335fdcbfe04025f96b2c325d58f843ff /src/setu/gnunet-service-setu.c | |
parent | 75ae0e1aef8d4a0f868c8453741ebe39757b4289 (diff) | |
download | gnunet-8095b1a1bc73d084d2e0e34a529ea52e17fd7355.tar.gz gnunet-8095b1a1bc73d084d2e0e34a529ea52e17fd7355.zip |
SetU move check to union
Diffstat (limited to 'src/setu/gnunet-service-setu.c')
-rw-r--r-- | src/setu/gnunet-service-setu.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c index f06e9cf9b..540628afa 100644 --- a/src/setu/gnunet-service-setu.c +++ b/src/setu/gnunet-service-setu.c | |||
@@ -2058,13 +2058,7 @@ check_union_p2p_full_element (void *cls, | |||
2058 | struct Operation *op = cls; | 2058 | struct Operation *op = cls; |
2059 | 2059 | ||
2060 | (void) op; | 2060 | (void) op; |
2061 | /* Allow only receiving of full element message if in expect IBF or in PHASE_FULL_RECEIVING state */ | 2061 | |
2062 | if ( (PHASE_EXPECT_IBF != op->phase) && | ||
2063 | (PHASE_FULL_RECEIVING != op->phase) ) | ||
2064 | { | ||
2065 | GNUNET_break_op (0); | ||
2066 | return GNUNET_SYSERR; | ||
2067 | } | ||
2068 | // FIXME: check that we expect full elements here? | 2062 | // FIXME: check that we expect full elements here? |
2069 | return GNUNET_OK; | 2063 | return GNUNET_OK; |
2070 | } | 2064 | } |
@@ -2085,6 +2079,16 @@ handle_union_p2p_full_element (void *cls, | |||
2085 | struct KeyEntry *ke; | 2079 | struct KeyEntry *ke; |
2086 | uint16_t element_size; | 2080 | uint16_t element_size; |
2087 | 2081 | ||
2082 | |||
2083 | /* Allow only receiving of full element message if in expect IBF or in PHASE_FULL_RECEIVING state */ | ||
2084 | if ( (PHASE_EXPECT_IBF != op->phase) && | ||
2085 | (PHASE_FULL_RECEIVING != op->phase) ) | ||
2086 | { | ||
2087 | GNUNET_break_op (0); | ||
2088 | fail_union_operation (op); | ||
2089 | return; | ||
2090 | } | ||
2091 | |||
2088 | op->phase = PHASE_FULL_RECEIVING; | 2092 | op->phase = PHASE_FULL_RECEIVING; |
2089 | 2093 | ||
2090 | element_size = ntohs (emsg->header.size) | 2094 | element_size = ntohs (emsg->header.size) |