您的位置:首页 > 移动开发

cygwin下构建配置了ipv6的busybox

2009-06-16 10:44 375 查看
cygwin本身是不支持ipv6的,在cygwin的socket.h和in.h里可以看到ipv6相关的部分都被注释掉了,网上到是有ipv6的补丁,不过有评论说该补丁对非ipv6的环境有影响,所以也不能使用

分析busybox,它是在构建过程中生成applet_tables.exe时报的错,applet_tables.exe在构建过程中被调用,生成include/applet_tables.h,注册busybox配置了的命令及实现,也不可能跳过。

可以做如下修改:

 

修改 cygwin/usr/include/cygwin/socket.h
将下面的块
#if 0     /* Not yet */
#define AF_INET6        23              /* IP version 6 */
#endif

改为:
#ifdef ENABLE_FEATURE_IPV6     
#define AF_INET6        23              /* IP version 6 */
#endif

修改 cygwin/usr/include/cygwin/in.h
将下面的块
#ifdef USE_IPV6
/* IPv6 definitions as we start to include them. This is just
   a beginning dont get excited 8) */
struct in6_addr
{
  uint8_t    s6_addr[16];
};

struct sockaddr_in6
{
  sa_family_t   sin6_family;  /* AF_INET6 */
  in_port_t   sin6_port;  /* Port number. */
  uint32_t   sin6_flowinfo; /* Traffic class and flow inf. */
  struct in6_addr sin6_addr;  /* IPv6 address. */
  uint32_t   sin6_scope_id; /* Set of interfaces for a scope. */
};
#endif

改为:
 #if defined(USE_IPV6) || defined(ENABLE_FEATURE_IPV6)
/* IPv6 definitions as we start to include them. This is just
   a beginning dont get excited 8) */
struct in6_addr
{
  uint8_t    s6_addr[16];
};

struct sockaddr_in6
{
  sa_family_t   sin6_family;  /* AF_INET6 */
  in_port_t   sin6_port;  /* Port number. */
  uint32_t   sin6_flowinfo; /* Traffic class and flow inf. */
  struct in6_addr sin6_addr;  /* IPv6 address. */
  uint32_t   sin6_scope_id; /* Set of interfaces for a scope. */
};
#endif

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  struct applet include class