Hi everyone,
I am porting linux skb buffers to mbufs and stumbelded on this code
from artheros 6kl driver.
struct htc_conn_service_msg *conn_msg;
...
/* assemble connect service message */
conn_msg = (struct htc_conn_service_msg *) skb_put(skb, length);
if (conn_msg == NULL) {
goto free_packet;
}
memset(conn_msg, 0, sizeof(struct htc_conn_service_msg));
....
what skb_put does is get a pointer to the end of the buffer with
engouh space to write data there.
I have thought of chaning it to:
struct htc_conn_service_msg conn_msg;
...
memset(&conn_msg, 0, sizeof(struct htc_conn_service_msg));
....
if (m_append(m, length, (uint8_t *) &conn_msg)) {
goto free_packet;
}
I append to the mbuf in the end.
I would like to hear your opinion on this. Is there a better faster way?
br,
--
Monthadar Al Jaberi
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[email protected]"