#20904: WAN IPv4 address not shown in LuCi "Interfaces/WAN" (pppoe)
------------------------------+------------------------
  Reporter:  juanriccio@…     |      Owner:  developers
      Type:  defect           |     Status:  new
  Priority:  response-needed  |  Milestone:
 Component:  packages         |    Version:  Trunk
Resolution:                   |   Keywords:
------------------------------+------------------------

Comment (by jow):

 For reference, test protocol here:

 {{{
 ## testcase
 $ cat /tmp/ifa.c
 #include <netinet/in.Qh>
 #include <arpa/inet.h>
 #include <string.h>
 #include <sys/types.h>
 #include <ifaddrs.h>
 #include <stdio.h>

 int main(int argc, char **argv) {
         struct ifaddrs *ifa, *ifap;
         char local[32];
         char remote[32];

         if (!getifaddrs(&ifa)) {
                 for (ifap = ifa; ifap; ifap = ifap->ifa_next) {
                         if (!ifap->ifa_name || strcmp(ifap->ifa_name,
 argv[1]) ||
                             !ifap->ifa_addr || ifap->ifa_addr->sa_family
 != AF_INET)
                                 continue;

                         inet_ntop(AF_INET, &((struct sockaddr_in
 *)ifap->ifa_addr)->sin_addr, local, sizeof(local));

                         if (ifap->ifa_dstaddr)
                                 inet_ntop(AF_INET, &((struct sockaddr_in
 *)ifap->ifa_dstaddr)->sin_addr, remote, sizeof(remote));
                         else
                                 strcpy(remote, "(null)");

                         printf("local addr = %s / remote addr = %s\n",
 local, remote);
                         break;
                 }

                 freeifaddrs(ifa);
         }

         return 0;
 }


 ## glibc (Debian)
 # ip link add name dummy0 type dummy
 # ip addr add 1.1.1.1 peer 2.2.2.2 dev dummy0
 # /tmp/ifa dummy0
 local addr = 1.1.1.1 / remote addr = 2.2.2.2
 #

 ## musl (OpenWrt)
 # ip link add name dummy0 type dummy
 # ip addr add 1.1.1.1 peer 2.2.2.2 dev dummy0
 # /tmp/ifa dummy0
 local addr = 2.2.2.2 / remote addr = (null)
 #
 }}}

--
Ticket URL: <https://dev.openwrt.org/ticket/20904#comment:15>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets

Reply via email to