On 25.07.2018 08:01, josephjah wrote:
Hello, I'm trying to assign a static /128 address to a netif but I think I'm
doing something wrong. I'm using 2.0.3 (also tested latest mater). I can see
packets are being correctly received but when ethip6_output() is called it
can't seem to find the proper interface to send out on. I've stepped through
the code for a bit and it seems like it can't get what it needs from the ND6
module, almost as if there are no destination cache/hints. Does my
initialization code look sane? Do I need to set additional flags or enable a
module of some sort? Thanks in advance guys.

// For instance, I want to assign: fde4:da74:55b2:b9ee:6a99:930f:26b9:2df0

static ip6_addr_t ipaddr;
memcpy(&(ipaddr.addr), ip.rawIpData(), sizeof(ipaddr.addr));
lwipdev->mtu = MY_MTU;
lwipdev->name[0] = 'l';
lwipdev->name[1] = '0'+lwipInterfacesCount;
lwipdev->hwaddr_len = 6;
lwipdev->linkoutput = lwip_eth_tx;
lwipdev->ip6_autoconfig_enabled = 1;
mac.copyTo(lwipdev->hwaddr, lwipdev->hwaddr_len);
netif_add(lwipdev, NULL, NULL, NULL, NULL, tapif_init, ethernet_input);
lwipdev->state = this;
netif_create_ip6_linklocal_address(lwipdev, 1);
s8_t idx = 1;
netif_add_ip6_address(lwipdev, &ipaddr, &idx);
netif_set_default(lwipdev);
netif_set_up(lwipdev);
netif_set_link_up(lwipdev);
netif_ip6_addr_set_state(lwipdev, 1, IP6_ADDR_TENTATIVE);
lwipdev->output_ip6 = ethip6_output;

This code is totally not standard. You're mixing up responsibilities. However, I don't have an example of what you're trying to do right now. Does 'netif_ip6_addr_set()' not do what you want?


Simon

_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to