}
/* Attempt bind to local port */
- if ( ( rc = udp_bind ( conn, local_port ) ) != 0 )
+ if ( ( rc = udp_bind ( conn, local_port ) ) != 0 ) {
+ DBGC ( conn, "UDP %p could not bind to local port %d: %s\n",
+ conn, local_port, strerror ( rc ) );
return rc;
+ }
/* Add to UDP connection list */
list_add ( &conn->list, &udp_conns );
rc = conn->udp_op->senddata ( conn, conn->tx_pkb->data,
pkb_tailroom ( conn->tx_pkb ) );
+ if ( rc != 0 ) {
+ DBGC ( conn, "UDP %p application could not send packet: %s\n",
+ conn, strerror ( rc ) );
+ }
if ( conn->tx_pkb ) {
free_pkb ( conn->tx_pkb );
size_t len ) {
struct udp_header *udphdr;
struct pk_buff *pkb;
+ int rc;
/* Use precreated packet buffer if one is available */
if ( conn->tx_pkb ) {
ntohs ( udphdr->len ) );
/* Send it to the next layer for processing */
- return tcpip_tx ( pkb, &udp_protocol, peer, netdev, &udphdr->chksum );
+ if ( ( rc = tcpip_tx ( pkb, &udp_protocol, peer, netdev,
+ &udphdr->chksum ) ) != 0 ) {
+ DBGC ( conn, "UDP %p could not transmit packet: %s\n",
+ conn, strerror ( rc ) );
+ return rc;
+ }
+
+ return 0;
}
/**
/* Pass data to application */
rc = conn->udp_op->newdata ( conn, pkb->data, pkb_len ( pkb ),
st_src, st_dest );
+ if ( rc != 0 ) {
+ DBGC ( conn, "UDP %p application rejected packet: %s\n",
+ conn, strerror ( rc ) );
+ }
done:
free_pkb ( pkb );