+
+#else // assume BSD
+
+ if(!*gateway_str) {
+ switch(subnet.type) {
+ case SUBNET_IPV4:
+ if(!ipv4.type) {
+ fprintf(stderr, "Route requested but no Ifconfig\n");
+ return;
+ }
+
+ net2str(gateway_str, sizeof(gateway_str), &ipv4);
+ break;
+
+ case SUBNET_IPV6:
+ if(!ipv6.type) {
+ fprintf(stderr, "Route requested but no Ifconfig\n");
+ return;
+ }
+
+ net2str(gateway_str, sizeof(gateway_str), &ipv6);
+ break;
+
+ default:
+ return;
+ }
+
+ char *slash = strchr(gateway_str, '/');
+
+ if(slash) {
+ *slash = 0;
+ }
+ }
+
+ switch(subnet.type) {
+ case SUBNET_IPV4:
+ fprintf(out, "route add %s %s\n", subnet_str, gateway_str);
+ break;
+
+ case SUBNET_IPV6:
+ fprintf(out, "route add -inet6 %s %s\n", subnet_str, gateway_str);
+ break;
+
+ default:
+ return;
+ }
+