diff options
| author | Mark Stapp <mjs@voltanet.io> | 2019-02-13 15:25:02 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-13 15:25:02 -0500 |
| commit | 77a4dd9320d2cc78ab6b57f98ea09f879d9272c6 (patch) | |
| tree | cd68f30ba7d49939353418dfa476bcb5dfabcc23 /sharpd/sharp_zebra.c | |
| parent | c919c6b6ef028d28643e978d55b4397fc749b79b (diff) | |
| parent | 80d5ff338da6fecbef297db3eb42a98711205fb2 (diff) | |
Merge pull request #3794 from donaldsharp/sharp_import_check
Sharp import check
Diffstat (limited to 'sharpd/sharp_zebra.c')
| -rw-r--r-- | sharpd/sharp_zebra.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/sharpd/sharp_zebra.c b/sharpd/sharp_zebra.c index 30e616a057..4682dbc73a 100644 --- a/sharpd/sharp_zebra.c +++ b/sharpd/sharp_zebra.c @@ -320,12 +320,22 @@ void route_delete(struct prefix *p, uint8_t instance) return; } -void sharp_zebra_nexthop_watch(struct prefix *p, bool watch, bool connected) +void sharp_zebra_nexthop_watch(struct prefix *p, bool import, + bool watch, bool connected) { - int command = ZEBRA_NEXTHOP_REGISTER; + int command; - if (!watch) - command = ZEBRA_NEXTHOP_UNREGISTER; + if (!import) { + command = ZEBRA_NEXTHOP_REGISTER; + + if (!watch) + command = ZEBRA_NEXTHOP_UNREGISTER; + } else { + command = ZEBRA_IMPORT_ROUTE_REGISTER; + + if (!watch) + command = ZEBRA_IMPORT_ROUTE_UNREGISTER; + } if (zclient_send_rnh(zclient, command, p, connected, VRF_DEFAULT) < 0) zlog_warn("%s: Failure to send nexthop to zebra", @@ -405,4 +415,5 @@ void sharp_zebra_init(void) zclient->interface_address_delete = interface_address_delete; zclient->route_notify_owner = route_notify_owner; zclient->nexthop_update = sharp_nexthop_update; + zclient->import_check_update = sharp_nexthop_update; } |
