Zaphod Beeblebrox
2009-Jun-16 05:29 UTC
Changes in the routing socket datagram between 7.0 and 7.2?
Did we change something in the routing socket's datagram between 7.0 and 7.2? I have a binary I compiled on 7.0-RELEASE and it fails to add a route on 7.2. If I recompile the source on 7.2, it works. Roughly put, the code make a datagram for the route socket like this: bzero(&rtmsg, sizeof(rtmsg)); /* Initial static part of the route message */ rtmsg.mrtm.rtm_msglen = sizeof(rtmsg); rtmsg.mrtm.rtm_type = RTM_ADD; rtmsg.mrtm.rtm_flags = RTF_UP | RTF_STATIC | RTF_GATEWAY; rtmsg.mrtm.rtm_version = RTM_VERSION; rtmsg.mrtm.rtm_addrs = RTA_DST | RTA_GATEWAY | RTA_NETMASK; /* Gateway will always be the same */ rtmsg.gateway.sin_family = AF_INET; rtmsg.gateway.sin_len = sizeof(rtmsg.gateway); /* Add a route to localhost for my address first */ rtmsg.dest.sin_addr.s_addr = cons->LtunAddr; rtmsg.mask.sin_addr.s_addr = INADDR_BROADCAST; rtmsg.mrtm.rtm_seq = htons(fsd->routeSeq++); rtmsg.gateway.sin_addr.s_addr = INADDR_LOOPBACK;