pablo(a)gnumonks.org wrote:
+++ b/openbsc/src/libmgcp/mgcp_network.c
@@ -371,10 +371,19 @@ static int rtp_data_net(struct osmo_fd *fd, unsigned int what)
..
+ switch (endp->type) {
+ case MGCP_RTP_DEFAULT:
+ return send_to(endp, DEST_BTS, proto == PROTO_RTP, &addr,
+ buf, rc);
+ case MGCP_RTP_TRANSCODED:
+ return send_transcoder(&endp->trans_net, endp->cfg,
+ proto == PROTO_RTP, buf, rc);
+ default:
+ LOGP(DMGCP, LOGL_ERROR, "Bad MGCP type %u on endpoint %u\n",
+ endp->type, ENDPOINT_NUMBER(endp));
+ }
+ return 0;
Please consider not having a default: case in the two switch ()
statements added by this patch.
No default: case makes the compiler warn if a value is added to the
enum in the future, without corresponding cases being added to the
switch ().
Since the pattern is to make each case return (I like it!) it would
be easy to move the LOGP() to before the return 0; to still get a
warning at runtime, even if the compile time warning was ignored.
//Peter