Index: sys/net/route/nhop_ctl.c =================================================================== --- sys/net/route/nhop_ctl.c +++ sys/net/route/nhop_ctl.c @@ -381,7 +381,11 @@ /* Update MTU if set in the request*/ set_nhop_mtu_from_info(nh, info); - /* XXX: allow only one of BLACKHOLE,REJECT,GATEWAY */ + /* allow only one of BLACKHOLE,REJECT,GATEWAY */ + if (((nh->nh_priv->rt_flags & RTF_BLACKHOLE) != 0) + + ((nh->nh_priv->rt_flags & RTF_REJECT) != 0) + + ((nh->nh_priv->rt_flags & RTF_GATEWAY) != 0) > 1) + return (EINVAL); /* Allow some flags (FLAG1,STATIC,BLACKHOLE,REJECT) to be toggled on change. */ nh->nh_priv->rt_flags &= ~RTF_FMASK;