[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-devel] Error compiling socket.c with LWIP_TCPIP_CORE_LOCKING=1
From: |
Simon Goldschmidt |
Subject: |
Re: [lwip-devel] Error compiling socket.c with LWIP_TCPIP_CORE_LOCKING=1 and LWIP_RAW=0 |
Date: |
Fri, 14 Oct 2011 14:19:56 +0200 |
As I said, I fixed that already. I also found 1 or 2 other lines that needed
fixing when cycling through disabling one of the three IP protocols...
Simon
Mason <address@hidden> wrote:
> Kieran Mansley wrote:
>
> > Mason wrote:
> >
> >> I suppose the patch involves sprinkling
> >> #ifdef LWIP_RAW
> >> #endif
> >> in strategic places?
> >
> > Yes. Should be easy to find the places as most will be checking for
> > NETCONN_RAW
>
> Here's the patch I've come up with. It might have a few rough edges.
> How do you handle conditional compilation mixed with if/else blocks?
>
> --- sockets.c.orig 2011-05-06 10:51:25.000000000 +0200
> +++ sockets.c 2011-10-14 14:04:27.328125000 +0200
> @@ -845,22 +845,29 @@
>
> if (to_in != NULL) {
> inet_addr_to_ipaddr_p(remote_addr, &to_in->sin_addr);
> remote_port = ntohs(to_in->sin_port);
> } else {
> - remote_addr = &sock->conn->pcb.raw->remote_ip;
> +#if LWIP_RAW
> if (sock->conn->type == NETCONN_RAW) {
> + remote_addr = &sock->conn->pcb.raw->remote_ip;
> remote_port = 0;
> - } else {
> + } else
> +#endif
> + {
> + remote_addr = &sock->conn->pcb.udp->remote_ip;
> remote_port = sock->conn->pcb.udp->remote_port;
> }
> }
>
> LOCK_TCPIP_CORE();
> +#if LWIP_RAW
> if (sock->conn->type == NETCONN_RAW) {
> err = sock->conn->last_err = raw_sendto(sock->conn->pcb.raw, p,
> remote_addr);
> - } else {
> + } else
> +#endif
> + {
> #if LWIP_UDP
> #if LWIP_CHECKSUM_ON_COPY && LWIP_NETIF_TX_SINGLE_PBUF
> err = sock->conn->last_err =
> udp_sendto_chksum(sock->conn->pcb.udp, p,
> remote_addr, remote_port, 1, chksum);
> #else /* LWIP_CHECKSUM_ON_COPY && LWIP_NETIF_TX_SINGLE_PBUF */
>
>
> --
> Regards.
>
> _______________________________________________
> lwip-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/lwip-devel
--
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de