-/* $OpenBSD: route.c,v 1.174 2014/07/12 18:44:22 tedu Exp $ */
+/* $OpenBSD: route.c,v 1.175 2014/07/29 12:18:41 mpi Exp $ */
/* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */
/*
}
#endif
- /*
- * Since RTP_LOCAL cannot be set by userland, make
- * sure that local routes are only modified by the
- * kernel.
- */
- if (rt->rt_flags & RTF_LOCAL && prio != RTP_LOCAL)
- senderr(EINVAL);
-
if ((rn = rnh->rnh_deladdr(info->rti_info[RTAX_DST],
info->rti_info[RTAX_NETMASK], rnh, rn)) == NULL)
senderr(ESRCH);
-/* $OpenBSD: route.h,v 1.94 2014/05/09 09:23:56 mpi Exp $ */
+/* $OpenBSD: route.h,v 1.95 2014/07/29 12:18:41 mpi Exp $ */
/* $NetBSD: route.h,v 1.9 1996/02/13 22:00:49 christos Exp $ */
/*
/* mask of RTF flags that are allowed to be modified by RTM_CHANGE */
#define RTF_FMASK \
(RTF_PROTO1 | RTF_PROTO2 | RTF_PROTO3 | RTF_BLACKHOLE | \
- RTF_REJECT | RTF_STATIC | RTF_MPLS)
+ RTF_REJECT | RTF_STATIC | RTF_MPLS | RTF_LOCAL | RTF_BROADCAST)
/* Routing priorities used by the different routing protocols */
#define RTP_NONE 0 /* unset priority use sane default */
-/* $OpenBSD: rtsock.c,v 1.149 2014/07/12 18:44:22 tedu Exp $ */
+/* $OpenBSD: rtsock.c,v 1.150 2014/07/29 12:18:41 mpi Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
}
- /* Do not let userland play with kernel-only flags. */
- if ((rtm->rtm_flags & (RTF_LOCAL|RTF_BROADCAST)) != 0) {
- error = EINVAL;
- goto fail;
- }
-
/* make sure that kernel-only bits are not set */
rtm->rtm_priority &= RTP_MASK;
rtm->rtm_flags &= ~(RTF_DONE|RTF_CLONED);
rtm->rtm_fmask &= RTF_FMASK;
if (rtm->rtm_priority != 0) {
- if (rtm->rtm_priority > RTP_MAX ||
- rtm->rtm_priority == RTP_LOCAL) {
+ if (rtm->rtm_priority > RTP_MAX) {
error = EINVAL;
goto fail;
}