From b2b6f8f33c934c87de580a1665acfe79e434b3ec Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 18 May 2017 11:41:01 +0200 Subject: [PATCH] Pre-revert nonmergeable changes Revert "ospf6d: fix decimal area ID cli" commit a27cb3cfe901d4f1378116bc91e6656aaed7c74c Revert "bgpd: add back unicast option to 'address-family vpnv(4&6)' Issue #459" commit 399598bf6b749daa15d70ad64fc885d00cde1225 Revert "Fix the memory leak" commit d8d58e98397d8442ec68f8d715b64d5e6000b903 Revert "zebra: 'no ip route 4.1.1.19 255.255.255.255 99' is ambiguous" commit 83f35619359379687f21c839d61121e4ebe72541 Revert "ospf6d: Allow unconfig of unknown lsa's" commit 5b0747d71df6006835ead8e6354f70b26f7bca80 Revert "Fix the "Dead assignment" of clang SA." commit 3a6570a1f145c49155d72a815441025085dd45ad Revert "snapcraft: Improve README.usage.md based on feedback received" commit 2a3a819a9c2b2c9700e6228e7352e53b3562776c Revert "zebra: stop deregistering static nexthops unless removing the static" commit 1dac3a9619c8436f81c7b37f0252574b0b677dd0 All of these changes do not apply on stable/3.0 due to either CLI changes or another fix already being present. Signed-off-by: David Lamparter --- bgpd/bgp_vty.c | 16 ----------- lib/csv.c | 7 ----- ospf6d/ospf6_area.c | 21 ++++++++++++-- ospf6d/ospf6_lsa.c | 26 ++--------------- ospfd/ospf_apiserver.c | 2 +- ospfd/ospf_vty.c | 9 ++++++ pimd/pim_register.c | 4 +-- snapcraft/README.usage.md | 59 ++++----------------------------------- zebra/zebra_mpls_vty.c | 4 +-- zebra/zebra_rib.c | 2 ++ 10 files changed, 42 insertions(+), 108 deletions(-) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 9d5a4bd1cf..eef11441d6 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -6147,13 +6147,6 @@ DEFUN (address_family_vpnv4, return CMD_SUCCESS; } -ALIAS (address_family_vpnv4, - address_family_vpnv4_unicast_cmd, - "address-family vpnv4 unicast", - "Enter Address Family command mode\n" - "Address family\n" - "Address Family modifier\n") - DEFUN (address_family_vpnv6, address_family_vpnv6_cmd, "address-family vpnv6", @@ -6164,13 +6157,6 @@ DEFUN (address_family_vpnv6, return CMD_SUCCESS; } -ALIAS (address_family_vpnv6, - address_family_vpnv6_unicast_cmd, - "address-family vpnv6 unicast", - "Enter Address Family command mode\n" - "Address family\n" - "Address Family modifier\n") - DEFUN (address_family_encap, address_family_encap_cmd, "address-family encap", @@ -15173,9 +15159,7 @@ bgp_vty_init (void) install_element (BGP_NODE, &address_family_ipv6_cmd); install_element (BGP_NODE, &address_family_ipv6_safi_cmd); install_element (BGP_NODE, &address_family_vpnv4_cmd); - install_element (BGP_NODE, &address_family_vpnv4_unicast_cmd); install_element (BGP_NODE, &address_family_vpnv6_cmd); - install_element (BGP_NODE, &address_family_vpnv6_unicast_cmd); install_element (BGP_NODE, &address_family_encap_cmd); install_element (BGP_NODE, &address_family_encapv4_cmd); install_element (BGP_NODE, &address_family_encapv6_cmd); diff --git a/lib/csv.c b/lib/csv.c index 95e3e97768..7df9292647 100644 --- a/lib/csv.c +++ b/lib/csv.c @@ -177,9 +177,6 @@ csv_decode_record(csv_record_t *rec) field = strpbrk(curr, ","); } field = strstr(curr, "\n"); - if (!field) { - return; - } fld = malloc(sizeof(csv_field_t)); if (field && fld) { fld->field = curr; @@ -242,10 +239,6 @@ csv_encode (csv_t *csv, rec = malloc(sizeof(csv_record_t)); if (!rec) { log_error("record malloc failed\n"); - if (!buf) { - free(str); - } - va_end(list); return (NULL); } csv_init_record(rec); diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c index 1691e501f8..bbab8598b8 100644 --- a/ospf6d/ospf6_area.c +++ b/ospf6d/ospf6_area.c @@ -406,11 +406,26 @@ ospf6_area_show (struct vty *vty, struct ospf6_area *oa) } +#define OSPF6_CMD_AREA_LOOKUP(str, oa) \ +{ \ + u_int32_t area_id = 0; \ + if (inet_pton (AF_INET, str, &area_id) != 1) \ + { \ + vty_out (vty, "Malformed Area-ID: %s%s", str, VNL); \ + return CMD_SUCCESS; \ + } \ + oa = ospf6_area_lookup (area_id, ospf6); \ + if (oa == NULL) \ + { \ + vty_out (vty, "No such Area: %s%s", str, VNL); \ + return CMD_SUCCESS; \ + } \ +} + #define OSPF6_CMD_AREA_GET(str, oa) \ { \ - char *ep; \ - u_int32_t area_id = htonl (strtol(str, &ep, 10)); \ - if (*ep && inet_pton (AF_INET, str, &area_id) != 1) \ + u_int32_t area_id = 0; \ + if (inet_pton (AF_INET, str, &area_id) != 1) \ { \ vty_out (vty, "Malformed Area-ID: %s%s", str, VNL); \ return CMD_SUCCESS; \ diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c index 867dc3d9d8..f3afd487e4 100644 --- a/ospf6d/ospf6_lsa.c +++ b/ospf6d/ospf6_lsa.c @@ -872,17 +872,7 @@ ALIAS (debug_ospf6_lsa_type, DEBUG_STR OSPF6_STR "Debug Link State Advertisements (LSAs)\n" - "Router LSA's\n" - "Network LSA's\n" - "Inter-Prefix LSA's\n" - "Inter-Router LSA's\n" - "AS-External LSA's\n" - "Link LSA's\n" - "Intra-Prefix LSA's\n" - "Unknown LSA's\n" - "Originate\n" - "Examine\n" - "Flooding\n" + "Specify LS type as Hexadecimal\n" ) DEFUN (no_debug_ospf6_lsa_type, @@ -938,22 +928,12 @@ DEFUN (no_debug_ospf6_lsa_type, ALIAS (no_debug_ospf6_lsa_type, no_debug_ospf6_lsa_hex_detail_cmd, - "no debug ospf6 lsa (router|network|inter-prefix|inter-router|as-external|link|intra-prefix|unknown) (originate|examine|flooding)", + "no debug ospf6 lsa (router|network|inter-prefix|inter-router|as-external|link|intra-prefix) (originate|examine|flooding)", NO_STR DEBUG_STR OSPF6_STR "Debug Link State Advertisements (LSAs)\n" - "Router LSA's\n" - "Network LSA's\n" - "Inter-Prefix LSA's\n" - "Inter-Router LSA's\n" - "AS-External LSA's\n" - "Link LSA's\n" - "Intra-Prefix LSA's\n" - "Unknown LSA's\n" - "Originate\n" - "Examine\n" - "Flooding\n" + "Specify LS type as Hexadecimal\n" ) void diff --git a/ospfd/ospf_apiserver.c b/ospfd/ospf_apiserver.c index 620dacb157..aac8ef4b8b 100644 --- a/ospfd/ospf_apiserver.c +++ b/ospfd/ospf_apiserver.c @@ -2459,7 +2459,7 @@ ospf_apiserver_clients_notify_nsm_change (struct ospf_neighbor *nbr) { struct msg *msg; struct in_addr ifaddr = { .s_addr = 0L }; - struct in_addr nbraddr; + struct in_addr nbraddr = { .s_addr = 0L }; assert (nbr); diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index b13c28d0c9..c65d148ff0 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -6763,6 +6763,7 @@ DEFUN (no_ip_ospf_cost, int ret; struct ospf_if_params *params; + ifp = vty->index; params = IF_DEF_PARAMS (ifp); if (argc == 1) @@ -6831,6 +6832,7 @@ DEFUN (no_ip_ospf_cost2, int ret; struct ospf_if_params *params; + ifp = vty->index; params = IF_DEF_PARAMS (ifp); /* According to the semantics we are mimicking "no ip ospf cost N" is @@ -7070,6 +7072,7 @@ DEFUN (no_ip_ospf_dead_interval, struct ospf_interface *oi; struct route_node *rn; + ifp = vty->index; params = IF_DEF_PARAMS (ifp); if (argc == 2) @@ -7244,6 +7247,7 @@ DEFUN (no_ip_ospf_hello_interval, int ret; struct ospf_if_params *params; + ifp = vty->index; params = IF_DEF_PARAMS (ifp); if (argc == 2) @@ -7521,6 +7525,7 @@ DEFUN (no_ip_ospf_priority, int ret; struct ospf_if_params *params; + ifp = vty->index; params = IF_DEF_PARAMS (ifp); if (argc == 2) @@ -7667,6 +7672,7 @@ DEFUN (no_ip_ospf_retransmit_interval, struct ospf_if_params *params; int addr_index; + ifp = vty->index; params = IF_DEF_PARAMS (ifp); if (argc >= 1) @@ -7738,6 +7744,7 @@ DEFUN (no_ip_ospf_retransmit_interval_sec, struct interface *ifp = vty->index; struct ospf_if_params *params; + ifp = vty->index; params = IF_DEF_PARAMS (ifp); UNSET_IF_PARAM (params, retransmit_interval); @@ -7822,6 +7829,7 @@ DEFUN (no_ip_ospf_transmit_delay, struct ospf_if_params *params; int addr_index; + ifp = vty->index; params = IF_DEF_PARAMS (ifp); if (argc >= 1) @@ -7894,6 +7902,7 @@ DEFUN (no_ip_ospf_transmit_delay_sec, struct interface *ifp = vty->index; struct ospf_if_params *params; + ifp = vty->index; params = IF_DEF_PARAMS (ifp); UNSET_IF_PARAM (params, transmit_delay); diff --git a/pimd/pim_register.c b/pimd/pim_register.c index 7844bd3399..ce3ac1a433 100644 --- a/pimd/pim_register.c +++ b/pimd/pim_register.c @@ -160,8 +160,8 @@ pim_register_recv (struct interface *ifp, int sentRegisterStop = 0; struct ip *ip_hdr; //size_t hlen; - struct in_addr group; - struct in_addr source; + struct in_addr group = { .s_addr = 0 }; + struct in_addr source = { .s_addr = 0 }; //uint8_t *msg; uint32_t *bits; diff --git a/snapcraft/README.usage.md b/snapcraft/README.usage.md index c678c8805c..aaff59438a 100644 --- a/snapcraft/README.usage.md +++ b/snapcraft/README.usage.md @@ -3,7 +3,7 @@ Using the FRRouting Snap After installing the Snap, the priviledged plug need to be connected: - snap connect frr:network-control core:network-control + snap connect frr:network-control ubuntu-core:network-control Enabling/Disabling FRRouting Daemons ------------------------------------------- @@ -53,74 +53,25 @@ depend on them). These are mainly intended to debug the Snap - `frr.ldpd-debug`: Starts ldpd daemon in foreground -MPLS (LDP) ----------- -The MPLS forwarding requires a Linux Kernel version 4.5 or newer and -specific MPLS kernel modules loaded. It will be auto-detected by -FRR. You can check the detected setup with the `show mpls status` -command from within `frr.vtysh` - -The following kernel modules `mpls-router` and `mpls-iptunnel` -need to be loaded. On Ubuntu 16.04, this can be done by editing -'/etc/modules-load.d/modules.conf' and add the following lines: - - # Load MPLS Kernel Modules - mpls-router - mpls-iptunnel - -For other distributions, please check the documentation on loading -modules. You need to either reboot or use `modprobe` to manually load -the modules as well before MPLS will be available. - -In addition to this, the MPLS Label-Processing needs to be enabled -with `sysctl` on the required interfaces. Assuming the interfaces -are named `eth0`, `eth1` and `eth2`, then the additional lines in -`/etc/sysctl.conf` will enable it on a Ubuntu 16.04 system: - - # Enable MPLS Label processing on all interfaces - net.mpls.conf.eth0.input=1 - net.mpls.conf.eth1.input=1 - net.mpls.conf.eth2.input=1 - net.mpls.platform_labels=100000 - -These settings require either a reboot or a manual configuration with -`sysctl` as well. - FAQ --- - frr.vtysh displays `--MORE--` on long output. How to suppress this? - Define `VTYSH_PAGER` to `cat` (default is `more`). (Ie add `export VTYSH_PAGER=cat` to the end of your `.profile`) -- ospfd / ospf6d are not running after installation - - Installing a new snap starts the daemons, but at this time they - may not have the required priviledged access. Make sure you - issue the `snap connect` command as given above (can be verified - with `snap interfaces`) and **THEN** restart the daemons (or - reboot the system). - This is a limitation of any snap package at this time which - requires priviledged interfaces (ie to manipulate routing tables) - Sourcecode available ==================== The source for this SNAP is available as part of the FRRouting -Source Code Distribution under `GPLv2 or later` +Source Code Distribution. - + https://github.com/frrouting/frr.git -Instructions for rebuilding the snap are in `snapcraft/README.snap_build.md` - -*Please checkout the desired branch before following the instructions -as they may have changed between versions of FRR* - -Official Webpage for FRR -======================== - -Official webpage for FRR is at +Instructions for rebuilding the snap are in `README.snap_build.md` Feedback welcome ================ Please send Feedback about this snap to Martin Winter at `mwinter@opensourcerouting.org` + diff --git a/zebra/zebra_mpls_vty.c b/zebra/zebra_mpls_vty.c index 343f2975e8..8b967c3af8 100644 --- a/zebra/zebra_mpls_vty.c +++ b/zebra/zebra_mpls_vty.c @@ -472,7 +472,7 @@ DEFUN (no_ip_route_tag_distance_label, DEFUN (no_ip_route_mask_distance_label, no_ip_route_mask_distance_label_cmd, - "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) <1-255> label WORD", + "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) <1-255>", NO_STR IP_STR "Establish static routes\n" @@ -486,7 +486,7 @@ DEFUN (no_ip_route_mask_distance_label, "One or more labels separated by '/'\n") { return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[0], argv[1], argv[2], NULL, NULL, - argv[3], NULL, argv[4]); + argv[3], NULL, argv[5]); } DEFUN (no_ip_route_mask_tag_distance_label, diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 23c4c9ebea..e48da0479b 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -366,6 +366,7 @@ nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set, if (set) { UNSET_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE); + zebra_deregister_rnh_static_nexthops(rib->vrf_id, nexthop->resolved, top); nexthops_free(nexthop->resolved); nexthop->resolved = NULL; rib->nexthop_mtu = 0; @@ -596,6 +597,7 @@ nexthop_active_ipv6 (struct rib *rib, struct nexthop *nexthop, int set, if (set) { UNSET_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE); + zebra_deregister_rnh_static_nexthops (rib->vrf_id, nexthop->resolved, top); nexthops_free(nexthop->resolved); nexthop->resolved = NULL; }