PPP, fixed LWIP_IPV4=1 and PPP_IPV4_SUPPORT=0 support

If LWIP_IPV4 is true but PPP_IPV4_SUPPORT is false, we need
a dummy ppp_netif_output_ip4() callback because we don't have
a netif_null_output_ip4() by default like we have for IPv6 with
netif_null_output_ip6().
This commit is contained in:
Sylvain Rochet 2015-04-13 23:07:42 +02:00
parent c865211c2f
commit 662f1355de

View File

@ -181,9 +181,9 @@ const struct protent* const protocols[] = {
/* Prototypes for procedures local to this file. */ /* Prototypes for procedures local to this file. */
static void ppp_do_connect(void *arg); static void ppp_do_connect(void *arg);
static err_t ppp_netif_init_cb(struct netif *netif); static err_t ppp_netif_init_cb(struct netif *netif);
#if PPP_IPV4_SUPPORT #if LWIP_IPV4
static err_t ppp_netif_output_ip4(struct netif *netif, struct pbuf *pb, const ip4_addr_t *ipaddr); static err_t ppp_netif_output_ip4(struct netif *netif, struct pbuf *pb, const ip4_addr_t *ipaddr);
#endif /* PPP_IPV4_SUPPORT */ #endif /* LWIP_IPV4 */
#if PPP_IPV6_SUPPORT #if PPP_IPV6_SUPPORT
static err_t ppp_netif_output_ip6(struct netif *netif, struct pbuf *pb, const ip6_addr_t *ipaddr); static err_t ppp_netif_output_ip6(struct netif *netif, struct pbuf *pb, const ip6_addr_t *ipaddr);
#endif /* PPP_IPV6_SUPPORT */ #endif /* PPP_IPV6_SUPPORT */
@ -412,10 +412,10 @@ static void ppp_do_connect(void *arg) {
static err_t ppp_netif_init_cb(struct netif *netif) { static err_t ppp_netif_init_cb(struct netif *netif) {
netif->name[0] = 'p'; netif->name[0] = 'p';
netif->name[1] = 'p'; netif->name[1] = 'p';
#if PPP_IPV4_SUPPORT #if LWIP_IPV4
/* FIXME: change that when netif_null_output_ip4() will materialize */ /* FIXME: change that when netif_null_output_ip4() will materialize */
netif->output = ppp_netif_output_ip4; netif->output = ppp_netif_output_ip4;
#endif /* PPP_IPV4_SUPPORT */ #endif /* LWIP_IPV4 */
#if PPP_IPV6_SUPPORT #if PPP_IPV6_SUPPORT
netif->output_ip6 = ppp_netif_output_ip6; netif->output_ip6 = ppp_netif_output_ip6;
#endif /* PPP_IPV6_SUPPORT */ #endif /* PPP_IPV6_SUPPORT */
@ -427,7 +427,7 @@ static err_t ppp_netif_init_cb(struct netif *netif) {
return ERR_OK; return ERR_OK;
} }
#if PPP_IPV4_SUPPORT #if LWIP_IPV4
/* /*
* Send an IPv4 packet on the given connection. * Send an IPv4 packet on the given connection.
*/ */
@ -453,7 +453,7 @@ static err_t ppp_netif_output_ip4(struct netif *netif, struct pbuf *pb, const ip
return ERR_IF; return ERR_IF;
#endif /* PPP_IPV4_SUPPORT */ #endif /* PPP_IPV4_SUPPORT */
} }
#endif /* PPP_IPV4_SUPPORT */ #endif /* LWIP_IPV4 */
#if PPP_IPV6_SUPPORT #if PPP_IPV6_SUPPORT
/* /*