{"action":"opened","issue":{"url":"https://api.github.com/repos/freerangerouting/frr/issues/33","repository_url":"https://api.github.com/repos/freerangerouting/frr","labels_url":"https://api.github.com/repos/freerangerouting/frr/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/freerangerouting/frr/issues/33/comments","events_url":"https://api.github.com/repos/freerangerouting/frr/issues/33/events","html_url":"https://github.com/freerangerouting/frr/issues/33","id":197962871,"number":33,"title":"Zebra does not check flags when updating static routes","user":{"login":"qlyoung","id":6827003,"avatar_url":"https://avatars.githubusercontent.com/u/6827003?v=3","gravatar_id":"","url":"https://api.github.com/users/qlyoung","html_url":"https://github.com/qlyoung","followers_url":"https://api.github.com/users/qlyoung/followers","following_url":"https://api.github.com/users/qlyoung/following{/other_user}","gists_url":"https://api.github.com/users/qlyoung/gists{/gist_id}","starred_url":"https://api.github.com/users/qlyoung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qlyoung/subscriptions","organizations_url":"https://api.github.com/users/qlyoung/orgs","repos_url":"https://api.github.com/users/qlyoung/repos","events_url":"https://api.github.com/users/qlyoung/events{/privacy}","received_events_url":"https://api.github.com/users/qlyoung/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-29T06:59:16Z","updated_at":"2016-12-29T06:59:16Z","closed_at":null,"body":"Before installing a new static route Zebra checks to see if an equivalent route already exists and deletes it before installing the new route.\r\n\r\nzebra_static.c\r\n```\r\n394   /* Do nothing if there is a same static route.  */\r\n395   for (si = rn->info; si; si = si->next)\r\n396     {\r\n397       if (type == si->type\r\n398           && (! gate ||\r\n399               ((afi == AFI_IP && IPV4_ADDR_SAME (gate, &si->addr.ipv4)) ||\r\n400                (afi == AFI_IP6 && IPV6_ADDR_SAME (gate, &si->addr.ipv6))))\r\n401           && (! ifindex || ifindex == si->ifindex))\r\n402         {\r\n403           if ((distance == si->distance) && (tag == si->tag) &&\r\n404               !memcmp (&si->snh_label, snh_label, sizeof (struct static_nh_label)))\r\n405             {\r\n406               route_unlock_node (rn);\r\n407               return 0;\r\n408             }\r\n409           else\r\n410             update = si;\r\n411         }\r\n412     }\r\n```\r\n\r\nThis fails to check the route flags, which results in behavior like this:\r\n\r\n```\r\ncumulus# conf t\r\ncumulus(config)# ip route 1.2.3.4/24 reject\r\ncumulus(config)# do show ip route static\r\nCodes: K - kernel route, C - connected, S - static, R - RIP,\r\n       O - OSPF, I - IS-IS, B - BGP, P - PIM, T - Table, v - VNC,\r\n       V - VPN,\r\n       > - selected route, * - FIB route\r\n\r\nS>* 1.2.3.0/24 [1/0] is directly connected, Null0, rej\r\ncumulus(config)# ip route 1.2.3.4/24 blackhole\r\ncumulus(config)# do show ip route static\r\nCodes: K - kernel route, C - connected, S - static, R - RIP,\r\n       O - OSPF, I - IS-IS, B - BGP, P - PIM, T - Table, v - VNC,\r\n       V - VPN,\r\n       > - selected route, * - FIB route\r\n\r\nS>* 1.2.3.0/24 [1/0] is directly connected, Null0, rej\r\ncumulus(config)#\r\n```\r\n\r\nThe route flags are still set to reject. Correct behavior:\r\n\r\n```\r\ncumulus# conf t\r\ncumulus(config)# ip route\r\n  A.B.C.D    IP destination prefix\r\n  A.B.C.D/M  IP destination prefix (e.g. 10.0.0.0/8)\r\ncumulus(config)# ip route 1.2.3.4/24 reject\r\ncumulus(config)# do show ip route static\r\nCodes: K - kernel route, C - connected, S - static, R - RIP,\r\n       O - OSPF, I - IS-IS, B - BGP, P - PIM, T - Table, v - VNC,\r\n       V - VPN,\r\n       > - selected route, * - FIB route\r\n\r\nS>* 1.2.3.0/24 [1/0] is directly connected, Null0, rej\r\ncumulus(config)# ip route 1.2.3.4/24 blackhole\r\ncumulus(config)# do show ip route static\r\nCodes: K - kernel route, C - connected, S - static, R - RIP,\r\n       O - OSPF, I - IS-IS, B - BGP, P - PIM, T - Table, v - VNC,\r\n       V - VPN,\r\n       > - selected route, * - FIB route\r\n\r\nS>* 1.2.3.0/24 [1/0] is directly connected, Null0, bh\r\ncumulus(config)#\r\n```\r\n\r\nThe route has been changed to a blackhole route."}}
{"actor":{"display_login":"qlyoung"}}