diff options
author | Ondrej Filip <feela@network.cz> | 2012-04-26 17:03:53 +0200 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 2012-04-26 17:03:53 +0200 |
commit | 1f85226ecb76d3803b8fe37eb0891c45a6557dcd (patch) | |
tree | b0e51334e0f5a788a7203a22e19b7069806c6a47 /sysdep/linux/netlink/netlink.c | |
parent | 92f8f7e3a3a5a42768c18c1f3d4d8f9f98150c61 (diff) | |
parent | d9b77cc28115e5c1ef64c69722c9d1fd1392dcd1 (diff) |
Merge branch 'master' of ssh://git.nic.cz/bird
Diffstat (limited to 'sysdep/linux/netlink/netlink.c')
-rw-r--r-- | sysdep/linux/netlink/netlink.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sysdep/linux/netlink/netlink.c b/sysdep/linux/netlink/netlink.c index d9d22d4c..182088a1 100644 --- a/sysdep/linux/netlink/netlink.c +++ b/sysdep/linux/netlink/netlink.c @@ -588,9 +588,9 @@ krt_capable(rte *e) switch (a->dest) { case RTD_ROUTER: - if (ipa_has_link_scope(a->gw) && (a->iface == NULL)) - return 0; case RTD_DEVICE: + if (a->iface == NULL) + return 0; case RTD_BLACKHOLE: case RTD_UNREACHABLE: case RTD_PROHIBIT: @@ -653,20 +653,16 @@ nl_send_route(struct krt_proto *p, rte *e, struct ea_list *eattrs, int new) if (ea = ea_find(eattrs, EA_KRT_REALM)) nl_add_attr_u32(&r.h, sizeof(r), RTA_FLOW, ea->u.data); + /* a->iface != NULL checked in krt_capable() for router and device routes */ + switch (a->dest) { case RTD_ROUTER: r.r.rtm_type = RTN_UNICAST; + nl_add_attr_u32(&r.h, sizeof(r), RTA_OIF, a->iface->index); nl_add_attr_ipa(&r.h, sizeof(r), RTA_GATEWAY, a->gw); - - /* a->iface != NULL checked in krt_capable() */ - if (ipa_has_link_scope(a->gw)) - nl_add_attr_u32(&r.h, sizeof(r), RTA_OIF, a->iface->index); - break; case RTD_DEVICE: - if (!a->iface) - return -1; r.r.rtm_type = RTN_UNICAST; nl_add_attr_u32(&r.h, sizeof(r), RTA_OIF, a->iface->index); break; |