Skip to content

Commit f72413c

Browse files
czp182alandekok
authored andcommitted
fix: 1. exact duplicate code removed
2. return 0 --> return -1 (for invalid discriminator/state) (protocols/bfd: fix duplicate detect_multi check and wrong return value in decode_proto 433)
1 parent 939fdaf commit f72413c

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/protocols/bfd/decode.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,6 @@ static ssize_t fr_bfd_decode_proto(TALLOC_CTX *ctx, fr_pair_list_t *out,
147147
return -1;
148148
}
149149

150-
if (packet->detect_multi == 0) {
151-
fr_strerror_const("Packet.detect-multi has invalid value zero");
152-
return -1;
153-
}
154-
155150
if (packet->multipoint != 0) {
156151
fr_strerror_const("Packet.multipoint has invalid non-zero value");
157152
return -1;
@@ -166,7 +161,7 @@ static ssize_t fr_bfd_decode_proto(TALLOC_CTX *ctx, fr_pair_list_t *out,
166161
!((packet->state == BFD_STATE_DOWN) ||
167162
(packet->state == BFD_STATE_ADMIN_DOWN))) {
168163
fr_strerror_const("Packet has invalid values for your-discriminator and state");
169-
return 0;
164+
return -1;
170165
}
171166

172167
/*

0 commit comments

Comments
 (0)