This makes ND6 and ARP layers happy since they both check for this flag,
but is was redundant to provide route(8)'s "-llinfo" option when adding
a l2 route.
RTF_LLINFO is clearly redundant for userland tools, so only allow the
kernel to set it.
ok benno@, claudio@
-/* $OpenBSD: route.h,v 1.105 2015/02/11 23:34:43 mpi Exp $ */
+/* $OpenBSD: route.h,v 1.106 2015/05/05 09:41:43 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_LLINFO | RTF_PROTO1 | RTF_PROTO2 | RTF_PROTO3 | RTF_BLACKHOLE | \
RTF_REJECT | RTF_STATIC | RTF_MPLS | RTF_LOCAL | RTF_BROADCAST)
/* Routing priorities used by the different routing protocols */
-/* $OpenBSD: rtsock.c,v 1.157 2015/02/11 23:34:43 mpi Exp $ */
+/* $OpenBSD: rtsock.c,v 1.158 2015/05/05 09:41:43 mpi Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
info.rti_mpls = rtm->rtm_mpls;
#endif
+ if (info.rti_info[RTAX_GATEWAY] != NULL &&
+ info.rti_info[RTAX_GATEWAY]->sa_family == AF_LINK &&
+ (info.rti_flags & RTF_CLONING) == 0) {
+ info.rti_flags |= RTF_LLINFO;
+ }
+
switch (rtm->rtm_type) {
case RTM_ADD:
if (info.rti_info[RTAX_GATEWAY] == NULL) {