Don't call the forward function if it is not defined
This commit is contained in:
parent
18fd561041
commit
bfd5db667a
|
@ -33,7 +33,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* This file is part of the Contiki operating system.
|
||||||
*
|
*
|
||||||
* $Id: mh.c,v 1.4 2007/11/28 19:55:27 adamdunkels Exp $
|
* $Id: mh.c,v 1.5 2007/12/05 13:25:07 adamdunkels Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -116,7 +116,10 @@ mh_send(struct mh_conn *c, rimeaddr_t *to)
|
||||||
{
|
{
|
||||||
rimeaddr_t *nexthop;
|
rimeaddr_t *nexthop;
|
||||||
struct data_hdr *hdr;
|
struct data_hdr *hdr;
|
||||||
|
|
||||||
|
if(c->cb->forward == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
nexthop = c->cb->forward(c, &rimeaddr_node_addr, to, NULL, 0);
|
nexthop = c->cb->forward(c, &rimeaddr_node_addr, to, NULL, 0);
|
||||||
|
|
||||||
if(nexthop == NULL) {
|
if(nexthop == NULL) {
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* This file is part of the Contiki operating system.
|
||||||
*
|
*
|
||||||
* $Id: rmh.c,v 1.3 2007/11/27 23:32:34 adamdunkels Exp $
|
* $Id: rmh.c,v 1.4 2007/12/05 13:25:07 adamdunkels Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -131,6 +131,11 @@ rmh_send(struct rmh_conn *c, rimeaddr_t *to, u8_t num_rexmit, u8_t max_hops)
|
||||||
struct data_hdr *hdr;
|
struct data_hdr *hdr;
|
||||||
|
|
||||||
c->num_rexmit = num_rexmit;
|
c->num_rexmit = num_rexmit;
|
||||||
|
|
||||||
|
if(c->cb->forward == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
nexthop = c->cb->forward(c, &rimeaddr_node_addr, to, NULL, 0);
|
nexthop = c->cb->forward(c, &rimeaddr_node_addr, to, NULL, 0);
|
||||||
if(nexthop == NULL) {
|
if(nexthop == NULL) {
|
||||||
PRINTF("rmh_send: no route\n");
|
PRINTF("rmh_send: no route\n");
|
||||||
|
|
Loading…
Reference in a new issue