- 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;
+ 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;