Included patch #5938: changed raw_pcb.protocol from u16_t to u8_t since for IPv4 and IPv6, proto is only 8 bits wide. This affects the api, as there, the protocol was u16_t, too.

This commit is contained in:
goldsimon
2007-05-22 07:31:06 +00:00
parent 980af63b8d
commit 81ac03a28b
7 changed files with 18 additions and 11 deletions

View File

@@ -182,7 +182,7 @@ netbuf_copy_partial(struct netbuf *buf, void *dataptr, u16_t len, u16_t offset)
}
struct
netconn *netconn_new_with_proto_and_callback(enum netconn_type t, u16_t proto,
netconn *netconn_new_with_proto_and_callback(enum netconn_type t, u8_t proto,
void (*callback)(struct netconn *, enum netconn_evt, u16_t len))
{
struct netconn *conn;
@@ -218,7 +218,7 @@ netconn *netconn_new_with_proto_and_callback(enum netconn_type t, u16_t proto,
#endif /* LWIP_SO_RCVTIMEO */
msg.function = do_newconn;
msg.msg.msg.bc.port = proto; /* misusing the port field */
msg.msg.msg.raw_proto = proto;
msg.msg.conn = conn;
tcpip_apimsg(&msg);
@@ -682,7 +682,7 @@ netconn_join_leave_group (struct netconn *conn,
msg.function = do_join_leave_group;
msg.msg.conn = conn;
msg.msg.msg.bc.ipaddr = (struct ip_addr *)ipaddr;
msg.msg.msg.bc.port = join_or_leave;
msg.msg.msg.bc.port = join_or_leave; /* misusing the port field */
tcpip_apimsg(&msg);
return conn->err;
}

View File

@@ -293,7 +293,7 @@ pcb_new(struct api_msg_msg *msg)
switch(msg->conn->type) {
#if LWIP_RAW
case NETCONN_RAW:
msg->conn->pcb.raw = raw_new(msg->msg.bc.port); /* misusing the port field */
msg->conn->pcb.raw = raw_new(msg->msg.raw_proto);
if(msg->conn->pcb.raw == NULL) {
msg->conn->err = ERR_MEM;
break;
@@ -667,7 +667,7 @@ do_join_leave_group(struct api_msg_msg *msg)
case NETCONN_UDPLITE:
case NETCONN_UDPNOCHKSUM:
case NETCONN_UDP:
switch(msg->msg.bc.port){
switch(msg->msg.bc.port){ /* misusing the port field */
case NETCONN_JOIN: msg->conn->err = igmp_joingroup (netif_default, ((struct ip_addr**)(msg->msg.bc.ipaddr))[0]); break;
case NETCONN_LEAVE: msg->conn->err = igmp_leavegroup(netif_default, ((struct ip_addr**)(msg->msg.bc.ipaddr))[0]); break;
}