Skip to content

Commit b31c70d

Browse files
committed
BSD: Ensure we have a netmask when adding it to the route message
1 parent 491cc3e commit b31c70d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/if-bsd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ if_route(unsigned char cmd, const struct rt *rt)
796796
}
797797
}
798798

799-
if (!(rtm->rtm_flags & RTF_HOST))
799+
if (!sa_is_unspecified(&rt->rt_netmask) && !(rtm->rtm_flags & RTF_HOST))
800800
rtm->rtm_addrs |= RTA_NETMASK;
801801

802802
if_linkaddr(&sdl, rt->rt_ifp);

0 commit comments

Comments
 (0)